I have a simple Winbatch script that I use to reboot remote problematic PCs:
winhide("")
IntControl(67,0,1,0,0)
I invoke with across the network (after copying the executable to the remote local drive) with psexec, such as:
psexec \\pcname "C:\utils\reboot.exe"
The problem with the system is that often, the problem PC is so sluggish, that the psexec service takes a long time (sometimes, I just give up and pull the plug) to be invoked on the remote PC. I always pull the plug as a last resort, as this can damage the OS of Windows PCs.
Is there a quicker way to get this done. Assuming that I am a domain admin on my PC, does Winbatch have any kind of Psexec like utility that I can use to get the reboot script to launch instantly on the problem PC. By the time I need to do this, usually the problem PCs console is frozen, but I don't have any problems copying files to the drive share.
There is an IntControl function call that can initiate a reboot, however, if psexec can't do anything, I suspect that WinBatch won't fare any better.
One possibility is
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Networks~-~Servers/Microsoft~Client/wNT+Remotely~Reboot~and~wntShutDown.txt (http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Networks~-~Servers/Microsoft~Client/wNT+Remotely~Reboot~and~wntShutDown.txt)
but no guarantee of a better outcome as mentioned.
Thanks,
I'll try the script the next time I have problems with my normal routine.
I use this:
code = 6 ;Reboot
logon = "domain\admin"
pswd = "Pass"
RmtComputer = "computer"
objLocator = ObjectCreate("WbemScripting.SWbemLocator")
objWMIService = objLocator.ConnectServer(RmtComputer,"root/cimv2",logonname,pswd)
colFiles = objWMIService.ExecQuery ("Select Name From Win32_OperatingSystem")
ForEach objFile In colFiles
objFile.Win32ShutDown(code)
Next