• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Writing a batch file in windows 7 to rescan disk

endoftheline2

Junior Member
I'm looking for a command that I can put in a batch file that will automatically "Rescan Disks"

See screenshot: <a target=_blank class=ftalternatingbarlinklarge href="http:// <a target=_blank class=ftalternatingbarlinklarge href="http://img297.imageshack.us/img297/8277/rescandisks.jpg">http://img297.imageshack.u...7/8277/rescandisks.jpg</a>">http://img297.imageshack.us/img297/8277/rescandisks.jpg</a>
Basically I have a drive connected via ESATA and it only comes on sometimes, unless I rescan disks and then it always turns on.

So I am trying to make a batch file with a command to rescan the disks, that I can then set to run using the windows scheduled tasks, at a certain time, so the computer will awake from sleep and then rescans the disks automatically, and then My backup will be able to run.
 
Looks like MSDN refers to the diskpart.exe tool, If not present on your computer, find it on your vista CD and place it in system32 (or wherever you want, just somewhere out of the way), should be able to make the bat/cmd file say

@ECHO OFF
%WINDIR%\System32\diskpart.exe rescan

Please refer to this technet article for a full list of command line options for diskpart.exe and as always you can do %WINDIR%\System32\diskpart.exe /? and it should display it's commands. Also please note that if you place the executable in a directory path that contains spaces you will need to quote the explicit path in the batch file.

IE: "%WINDIR%\Windows Tools\diskpart.exe" rescan
 
Back
Top