Hi there
since hours I can't find the solution to this problem:
I try to check with defrag c: -a if defragmentation is necessary.
$str_l = "C:\"
Local $RunCMD = @ComSpec & " /c " & @SystemDir & "\defrag.exe " & $str_l & " -a"
Local $f01 = Run($RunCMD, @SystemDir, @SW_MINIMIZE, $STDERR_MERGED + $STDOUT_CHILD)
That works fine with XP and Server 2003 32bit. When I start it on a 2003 64 bit machine, I always get the following error:
'C:\WINDOWS\SysWOW64\defrag.exe' is not recognized as an internal or external command,operable program or batch file.
So I tried several different ways to give the correct path with the run command, like @WindowsDir & "\system32\defrag.exe", also in the Run-Workingdir Parameter without any success: (and C:\WINDOWS\system32\defrag.exe is definitely the correct path!)
'C:\WINDOWS\system32\defrag.exe' is not recognized as an internal or external command,operable program or batch file.
The Example code works, when I compile the script for x64, but then it won't work on x32 machines. But I need ONE script for both systems....
Any suggestions?
Thanks a lot!