Could someone modify the 8-day uptime script so that I can make an endpoint reboot immediately?
Hi @howard@computerconsult.org
Please refer this script procedure https://scripts.comodo.com/frontend/web/topic/restart-operations
Also, you can simply select and reboot the device from the device view section of ITSM portal.
Thanks
May I assume adding a /f will work to force the reboot? See modification below.
import subprocess;
sysdown=subprocess.Popen((‘shutdown /r /f ‘),shell=True,stdout=subprocess.PIPE);
for line in iter(sysdown.stdout.readline,’’):
print line.rstrip();
Hi @howard@computerconsult.org
The switch “/f” can be used along with the switch “/t”. But it cannot be used alone as in the general case.
Please consider below example,
Restart the local system in 30 seconds time.
shutdown.exe /r /f /t 30
Here “/f” refers force running applications to close without forewarning users
Thanks