How can I spin up a drive with batch script?

0

How can I spin up a drive using batch script. I have a daily sync script between my PC and my file server. The drives on my file server spin down during periods of inactivity which is desired.

However, my sync script which runs a 3rd party sync app; sometimes the 3rd party app errors because the drives does not spin up before it times out.

I have tried adding to my script a DIR X:\ command as a way to spin up the drive. However, it appears that windows caches the view of the top level and some sub directories of the drive and the drive still does not spin up. I tried adding all sub directories switch /s. That did work but was time consuming to have the script complete that command.

Valamas

Posted 2013-11-28T21:13:16.827

Reputation: 1 275

Answers

2

I found this command spun up the drive. Writing a small file and then deleting it.

echo > X:\spinup.tmp
del X:\spinup.tmp

I also added this command to give the drives some extra time to spin up.

timeout 3

Valamas

Posted 2013-11-28T21:13:16.827

Reputation: 1 275