win32com (VBScript to Python) problem

Duncan Booth duncan at NOSPAMrcp.co.uk
Tue Nov 25 07:35:42 EST 2003


Tim Howarth <tim at worthy.demon.co.uk> wrote in 
news:6e24de564c.tim at worthy.demon.co.uk:

> I want to use this to shutdown all machines in the school in which I
> work from a schedule on a server.
> 
> I could use the VBscript version but there are long delays if a machine
> is switched off - in Python I can thread the communication with
> individual machines (to achieve this in VBScript I have to call a new
> instance of w(c)script for each machine), effectively shutting them
> down in parallel.

This isn't a Python solution at all, but have you looked at PsTools 
(http://www.sysinternals.com)? It includes a command to remotely shutdown a 
machine including options to specify whether to log the user off, poweroff, 
reboot, hibernate etc. There is also a timeout so you can give users a 
chance to save their work (it displays a popup on their screen telling them 
the system is shutting down). You could just spawn a bunch of psshutdown 
processes off in parallel. It is free, although you cannot further 
redistribute it.

PsTools also includes other programs which could be useful in a classroom 
environment (useful for teachers, devastating if the pupils get their hands 
on them and you don't have security set up right).

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?




More information about the Python-list mailing list