[wpkg-users] Silent and/or Periodic WPKG Service?
Troy Hamilton
troy.a.hamilton at gmail.com
Fri Oct 31 17:46:22 CET 2008
Hi David,
On Fri, Oct 31, 2008 at 7:00 AM, David Davies <ddavies at apriori.com> wrote:
> 2. Instead of on startup prior to login, is there a way to run WPKG
> silently from a service after the machine is already on? It would be
> nice if I could set it to run at a particular time interval (e.g, every
> 4 hours, once per day, etc.), resulting in a periodic pull of new
> software sort of like Windows Updates.
Here is my method: wpkg-service-install.bat
----------------------------------------------
@ECHO OFF
:: Note: be sure that srvany.exe is in the system32 directory and that
:: setacl.exe is in your path
set server=%1
sc delete wpkg
:: This will show a command window to the user
::sc create wpkg binpath= "%systemroot%\system32\srvany.exe" type= own
type= interact
:: This one won't show them anything
sc create wpkg binpath= "%systemroot%\system32\srvany.exe" type= own
:: Give limited users permission to start the service
setacl.exe -on "wpkg" -ot srv -actn ace -ace "n:Domain Users;p:start_stop"
:: Tell srvany where to find wpkg
reg add "HKLM\SYSTEM\CurrentControlSet\Services\wpkg\Parameters" /v
"AppDirectory" /t REG_SZ /f /d "%systemroot%\system32
reg add "HKLM\SYSTEM\CurrentControlSet\Services\wpkg\Parameters" /v
"Application" /t REG_SZ /f /d "\\%server%\software\wpkg\wpkg-start.bat
:: Start it immediately
net start wpkg
:: Or wait until the next user logs in
::reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v
wpkg /t REG_SZ /d "net start wpkg" /f
:: Or run it each time a user logs in
::reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v wpkg
/t REG_SZ /d "net start wpkg" /f
----------------------------------------------------
With this method, you'll want to make sure that "Domain Computers" or
equivalent have access to the share(s) since the service doesn't run
as a domain user (although it could).
I also have a cron service running on each workstation, so I just have
a crontab entry of:
0 0 * * * net start wpkg
which runs wpkg each midnight.
BTW, I've also got "net stop wpkg" at the end of wpkg-start.bat.
Cheers,
---Troy
More information about the wpkg-users
mailing list