Create a vb script (I called it t.vbs) On Error Resume Next const wbemFlagReturnImmediately = &h10 const wbemFlagForwardOnly = &h20 set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) for each objItem In colItems WScript.Echo "Found " & objItem.Name & " " & objItem.Description if objItem.Name = "D:" then WScript.Echo "Drive type is " & objItem.Description if objItem.DriveType=3 then WScript.Quit(0) 'This is a Local Fixed Disk else WScript.Quit(1) 'D: is not a Local Fixed Disk no need to continue end if end if next WScript.Quit(1) Call this from a batch file and use the return value. @echo off cscript -nologo "%~dp0t.vbs" if not errorlevel 1 ( echo Moving my documents to the D: drive ) You could also modify the script to use WshShell.Run to directly call a batch file. set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run(strCommand, [intWindowStyle], [bWaitOnReturn]) Note: You will also need to modify the "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal" registry key so Windows knows where you put the My Documents folder.