Hello everyone, I am making a script that opens the command prompt and starts a program, (Disk2VHD). Making a backup of my hard drive . then compresses the file after completing using 7zip.
I have tested each part of the script, and each part works individually, but when I put them all together the program hangs up after closing Disk2VHD. I am open to any advice, and would be grateful for any help in solving this issue.
Thanks,
Ryan
Run("cmd.exe") ; opens command promptWinWaitActive("Administrator: C:\Windows\system32\cmd.exe") ;wait for command prompt to become active windowSleep (2000) ; wait before sending text to command promptSend("cd c:\""program files (x86)""\disk2vhd && start disk2vhd.exe c: c:\VHD\Backup.vhd{ENTER}") ;start disk2vhd making a copy of C: drive and store it in the VHD subfolderWinSetState ( "Administrator: C:\Windows\system32\cmd.exe", "" , @SW_HIDE ) ;hide command prompt while Disk2VHD is workingWinWaitActive("Disk2vhd - Sysinternals: www.sysinternals.com", "Disk export to VHD completed successfully.") ;wait for Disk2VHD to finish making VHDSleep(2000) ;wait after Disk2VHD has finished fully before closingProcessClose("disk2vhd.exe") ;end disk2vhd processProcessClose("disk2vhd-tmp.exe") ;close disk2vhdSleep(1000) ;wait after closing disk2vhdWinSetState("Administrator: C:\Windows\system32\cmd.exe", "" , @SW_SHOW) ;show command promptWinActivate("Administrator: C:\Windows\system32\cmd.exe") ;make command prompt the active windowWinWaitActive("Administrator: C:\Windows\system32\cmd.exe") ;wait until command prompt is the active windowSend("cd c:\""program files (x86)""\7-zip && 7z a c:\vhd\backup.zip c:\vhd\backup.VHD && exit {enter}") ;compress the vhd file using 7zip in the VHD subfolderExit ; end the script