Can I get remote PCs rebooted faster?

Started by dragon49, September 05, 2014, 10:08:51 AM

Previous topic - Next topic

dragon49

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.



DAG_P6

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.
David A. Gray
You are more important than any technology.

td

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

dragon49

Thanks,

I'll try the script the next time I have problems with my normal routine.

morenos1

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