[wpkg-users] [OT] Re: WPKG + Wireless Laptops

Malte Starostik lists at malte.homeip.net
Thu Feb 2 10:02:31 CET 2012


Hi Stefan,

Am Donnerstag, 2. Februar 2012, 09:55:04 schrieb Stefan Pendl:
> Am 02.02.2012 09:39, schrieb Paul McGrath:
> I am installing at shutdown, since there is no problem with running
> processes and working users.
> 
> For Windows 7 I use a scheduled task at 22:00, which will run WPKG.js
> and shuts the system down afterwards.
> This checks for a running explorer.exe process, which indicates a logged
> on user and skips the installation and shutdown if one is found.

(slightly OT, just about detecting logged on users) We use this in a .js 
script to shut down machines that have been woken on LAN for running WPKG and 
stuff but only shut them down if no one has logged on meanwhile.  Works even 
when someone is not using explorer.exe as a shell for whatever reason:

if (GetObject("winmgmts://./root/cimv2").ExecQuery("select UserName from 
Win32_ComputerSystem where not UserName is null").Count > 0) {
// Someone is logged in
}

Cheers,
Malte



More information about the wpkg-users mailing list