| View previous topic :: View next topic |
| Author |
Message |
3tones
Joined: 14 Dec 2004 Posts: 45 Location: Minneapolis, MN
|
Posted: Mon Mar 14, 2005 4:54 pm Post subject: looking for windows admin scripts |
|
|
I am looking for scripts to do the following:
1) AHK login script
-set in registry to run script off server everytime the user logs in
-check for updates in some way (any type of file/registry thing I want to apply)
-apply updates if needed
I can code this myself, just wondering if someone has something done already so I don't have to reinvent the wheel.
2) AHK logoff/shutdown script
This one will be a little harder. I have a WUS setup so the computer automatically update. The problem is, I don't want to bother the user to reboot in the middle of the day. I think there is a key in the registry to tell if updates are ready to install - so when the user shuts down, it would prompt them to install them in case they forgot. I started with something like this:
| Code: |
#Persistent
OnExit, ExitSub
return
ExitSub:
if A_ExitReason in Logoff,Shutdown
{
MsgBox, 4, , Are you sure you want to exit?
IfMsgBox, No, return
}
ExitApp
|
But Windows will end the task if they don't hit yes or no real quick. Is there anyway to capture and hold the shutdown process, aside from putting a "shutdown" icon on the desktop/start menu? |
|
| Back to top |
|
 |
3tones
Joined: 14 Dec 2004 Posts: 45 Location: Minneapolis, MN
|
Posted: Mon Mar 14, 2005 5:11 pm Post subject: Update: |
|
|
| I've found the shutdown script setting in gpedit.msc (w2k, btw) But now I need to detect if there are updates (has to be through the registry) and install them. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2419
|
Posted: Mon Mar 14, 2005 5:42 pm Post subject: Re: Update: |
|
|
| 3tones wrote: | | I've found the shutdown script setting in gpedit.msc (w2k, btw) But now I need to detect if there are updates (has to be through the registry) and install them. | Where would these updates be? What kind of updates? Install where? |
|
| Back to top |
|
 |
3tones
Joined: 14 Dec 2004 Posts: 45 Location: Minneapolis, MN
|
Posted: Mon Mar 14, 2005 7:02 pm Post subject: |
|
|
| Quote: |
Where would these updates be? What kind of updates? Install where?
|
Sorry for the ambiguity. What I envisioned was a way to keep the script as general as possible. In the script I could define updates, kept with a sequential index. These would be defined as labels.
| Code: |
==PSUEDO CODE - will not run==
==script on server, runs on computer==
current_patch_level = 6
get this computer's update level from ini file on server
is computer_patch_level less than current_patch_level?
If it is, apply patches in order until it is up to date
If everything is up to date quit
patch1:
copy a file from server to client
run the file
update patch status in init file
patch2:
import a registry file from the server
update patch status in init file
|
I know the code is simple, and I have most of it here already, I was just looking to see if someone had already built something similar. |
|
| Back to top |
|
 |
3tones
Joined: 14 Dec 2004 Posts: 45 Location: Minneapolis, MN
|
Posted: Mon Mar 14, 2005 7:16 pm Post subject: |
|
|
| Quote: |
Where would these updates be? What kind of updates? Install where?
|
Sorry... wrong part of my question. Here's the answer you were seeking:
As for the updates on shutdown, the updates would already be ready to go using WUS (windows update server) which I have going already on my computers. I am guessing there is a registry key, or another way I can detect if these updates are ready to install. Then I need to trigger the updates to actually install using the windows update mechanism. I havn't looked to much into a way to make this work and am wondering if someone else has done something similar. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2419
|
Posted: Mon Mar 14, 2005 7:37 pm Post subject: |
|
|
Thanks for clarifying . Other than looking for the icon in the tray I'm not sure... but you might be able to get an answer here: http://forums.susserver.com/ |
|
| Back to top |
|
 |
|