Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to spin-up a drive from a batch file running in windows host?

Featured Replies

Seems like a trivial task since most are struggling with keeping the disks spun down but I'm yet to find suitable solution. What I'm trying to do is getting my htpc blu-ray launcher script working smoothly with PowerDVD 9. It is currently something like this (pseudo code):

set display profile to 720p@60Hz
mount movie-iso-file
wait a few seconds
launch powerdvd
unmount movie-iso-file
set display profile to 720p@50Hz

I'm running Cachedirs to keep the disks spun down when performing directory listings. The problem that I'm facing, is that the mount software (Slysoft Virtual Clonedrive) returns the call immediatelly regardless of the state of the disk. In other words, it gets sufficient info on the file due to Cachedirs, returns the call and then proceeds to actually mount the image. If the disk is spun down, it takes more time to spin up the disk than it takes for PowerDVD to start up. And this results in PDVD displaying "No disk in drive G:" instead of playing the movie. You can recover by re-selecting the drive from the PDVD UI but this cannot be accomplished without mouse and the system is designed to be used with remote only (wife and small kids present here...). I could insert a long constant delay between mount and PDVD launch but that would cause the same delay to be unnecessarily present also when the disk is already spun up.

 

What I need is a command/tool/app to access the image file in a way which isn't affected by Cachedirs. Current workaround is to use "attrib" to change file read-only and back but I really hate to modify the file in any way. Any ideas?

Seems like a trivial task since most are struggling with keeping the disks spun down but I'm yet to find suitable solution. What I'm trying to do is getting my htpc blu-ray launcher script working smoothly with PowerDVD 9. It is currently something like this (pseudo code):

set display profile to 720p@60Hz
mount movie-iso-file
wait a few seconds
launch powerdvd
unmount movie-iso-file
set display profile to 720p@50Hz

I'm running Cachedirs to keep the disks spun down when performing directory listings. The problem that I'm facing, is that the mount software (Slysoft Virtual Clonedrive) returns the call immediatelly regardless of the state of the disk. In other words, it gets sufficient info on the file due to Cachedirs, returns the call and then proceeds to actually mount the image. If the disk is spun down, it takes more time to spin up the disk than it takes for PowerDVD to start up. And this results in PDVD displaying "No disk in drive G:" instead of playing the movie. You can recover by re-selecting the drive from the PDVD UI but this cannot be accomplished without mouse and the system is designed to be used with remote only (wife and small kids present here...). I could insert a long constant delay between mount and PDVD launch but that would cause the same delay to be unnecessarily present also when the disk is already spun up.

 

What I need is a command/tool/app to access the image file in a way which isn't affected by Cachedirs. Current workaround is to use "attrib" to change file read-only and back but I really hate to modify the file in any way. Any ideas?

 

I am not to familiar with bat scripting but if i get a chance tonight i will take a look and see what i can come up with.  I think though that you have already hit the nail on the head and found the problem you might run into, with the disk already possibly spinning.  Me, being a little lazy, would just put the "sleep/wait" command in the script and deal with the delay, even if the disk is already spun up.  On my modded xbox running XBMC it typically takes 5-10 seconds for the .ISO files to start playing, so a 5-10 second delay before launching PowerDVD would probably be enough.

 

check out this link http://www.ericphelps.com/batch/samples/samples.htm

there is a section in there about using the "start /wait" command.  i would thing that this could be used to make PowerDVD wait on the Slysoft program

What I need is a command/tool/app to access the image file in a way which isn't affected by Cachedirs. Current workaround is to use "attrib" to change file read-only and back but I really hate to modify the file in any way. Any ideas?

 

If it's accessed via disk share,

It can be any file  so if you could have file.iso.tmp and do an

echo > file.iso.tmp

del file.iso.tmp

 

the drive will surely have to spin up because you are writing to the drive.

 

If this is on a user share and not a disk share, then you somehow have to target the specific disk.

 

As suggested with the attrib, or even a temporary rename

 

rename file.iso file.iso.tmp

rename file.iso.tmp file.iso

 

I thought the attrib was a decent idea.

I suppose another choice is using copy file.iso nul:

This would surely read the whole file and possibly have it completely in cache for the rest of viewing.

  • Author

I am not to familiar with bat scripting but if i get a chance tonight i will take a look and see what i can come up with.  I think though that you have already hit the nail on the head and found the problem you might run into, with the disk already possibly spinning.  Me, being a little lazy, would just put the "sleep/wait" command in the script and deal with the delay, even if the disk is already spun up.  On my modded xbox running XBMC it typically takes 5-10 seconds for the .ISO files to start playing, so a 5-10 second delay before launching PowerDVD would probably be enough.

 

check out this link http://www.ericphelps.com/batch/samples/samples.htm

there is a section in there about using the "start /wait" command.  i would thing that this could be used to make PowerDVD wait on the Slysoft program

The problem with vcdmount is that it somehow signals the virtual disk service to mount the image (at least that is what I assume it is doing). Since that is the part which is non-blocking there is no application/window/process to be waited for to finish because the virtual disk service is always running. Since Slysoft's Virtual Clone Disk is one of the few free mounting softwares I will make a feature request to them.

 

I already have a constant delay which deals with the mounting delay but doesn't take into account possibly spun down disk. There is no direct way of sleeping in standard windows (sleep command is only available in some resource kit) but there are several workarounds. I'm using "ping -n 10 localhost >nul" which works ok if ~1 second accuracy is sufficient.

 

If it's accessed via disk share,

It can be any file  so if you could have file.iso.tmp and do an

echo > file.iso.tmp

del file.iso.tmp

 

the drive will surely have to spin up because you are writing to the drive.

 

If this is on a user share and not a disk share, then you somehow have to target the specific disk.

 

As suggested with the attrib, or even a temporary rename

 

rename file.iso file.iso.tmp

rename file.iso.tmp file.iso

 

I thought the attrib was a decent idea.

I suppose another choice is using copy file.iso nul:

This would surely read the whole file and possibly have it completely in cache for the rest of viewing.

My system is setup in a way that all the htpc-machines should use read-only user shares. So modifying/writing is not the best solution. Also reading/copying the file to nul is not ideal since the iso-images in question are full Blu-ray movies with sizes between 20-45GB.

 

But you both got me thinking, I could use any command line utility which first checks that file is of correct format (by reading the file header) and then fails. Unzip could be perfect for this job, at least one which doesn't know how to decompress iso-images.

 

Thanks for your ideas! I'll report back which solution was suitable.

What if you did something like a tai or headl command on the file before issuing the vcdmount?

I know it's not a normal windows too, but I bet you can find a windows version around the net.

 

If not I'm sure someone here could code up a quick program to read a couple hundred blocks from the start of the file.

  • Author

Thanks for the idea! I googled around for a while with head/tail and ended up downloading GNU Coreutils for Windows. It seemed the best (=stable and trustable source). Windows installer for v5.3.0 is located on this page:

http://gnuwin32.sourceforge.net/packages/coreutils.htm

http://gnuwin32.sourceforge.net/downlinks/coreutils.php

 

The actual command I´m currently using is:

head --bytes=1 movie.iso

, which is perfect since it really reads one byte from the file and thus is very fast.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.