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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.