In windows 7 a bat file was made:
rem set UD_LOG_FILE_PATH=%temp%\defrag_native.log C: cd \Windows\System32 udefrag.exe --optimize-mft C: udefrag.exe -o C: pause
I can double click the bat file and it runs OK. However, the bat file was made to be invoked from a running program. When the program shells out to the bat file the following error is produced:
'C:\Windows\System32\udefrag.exe' is not recognized as an internal or external command, operable program or batch file.
Invocation is done using Shell in VB6. Different things were tried. First the bat file was called directly, then with C:\Windows\System32\cmd.exe /c, then with C:\Windows\SysWOW64\cmd.exe /c. All produce the same result. The bat file runs but will not run the exe file within the bat file. But the bat file works OK if run directly. Please help. Thanks
udefrag.exe
actually in that folder? Or are you in fact running a command prompt that has a particularPATH
variable that just happens to work when you launch your bat file directly? – Dan PuzeyC:\Windows\System32\udefrag.exe
, it runs successfully? If that's the case then I'd suspect you're looking at a permissions issue. – Dan Puzey