Script Flow Process

Recommended Posts

ZenKensei 0

ZenKensei 0

Want to see if anyone has a better, cleaner way to do this. Currently I have 2 AutoIt Scripts (both will be compiled with the second script included in the compiled version of the first as a fileinstall). I will be running the 1st script via PSExec against either a remote server or workstation (and copying the script to the device so it exist locally). The initial script starts the schedule service on the target device and then sets an AT job for 11:00pm to run the second file (which is copied to the Windows folder as part of the fileinst). The second file basically checks to see if the device is a workstation or server, if workstation it forces a reboot, if server then if first shuts down a specific service before forcing a reboot.

What I would like to do is use just one single file (without a fileinstall) however I can't think how I could run the file a second time (actually at 11:00pm) without the script trying to start the schedule service again and setting another AT job... Here is the code I have so far:

Anyway to combine the 2 into one single file without a fileinstall, yet insure that the second time the file is ran (actually by the device at 11:00pm) it does not try to execute the code within the first script? Hope this makes sense...