Re: run once

From: Richard Mueller [MVP] (rlmueller-NOSPAM_at_ameritech.NOSPAM.net)
Date: 03/10/04


Date: Wed, 10 Mar 2004 12:02:50 -0600

Aaron wrote:

> Is there anyway to write a script that would only run once during startup
or
> login on each computer in the domain or group?
>

Hi,

For many years I used "Flag" files. This was in the days of Win95 and batch
files (before SMS). The logon script checked for a "flag" file. If it did
not exist, the batch program did whatever, then saved the "flag" file. If
the modification was to the machine, I saved the file to the hard drive. If
the change applied to the user, the flag file was saved in the home
directory. I also appended to a log file in a central shared location. I
wanted a way to tell when everyone was updated so I could remove the code
from the logon script. If something had to be pushed out again, we could
instruct users to delete the "flag" file, or we could do it for them if it
was in the home directory. If we screwed up and had to fix a bug in the
script, we used a different "flag" file. We had a folder in a standard
location for these.

Later, we used registry entries - in HKLM for things done once per machine,
in HKCU for things done once per user. If the registry entry exists, skip,
otherwise do whatever and save the registry entry. Note that logon scripts
can add to HKCU, but you usually need a startup script to add to HKLM. I
still like to log to a central location so I can tell when to retire code
from the logon or startup script.

Another option might be to use Group Policy software installation, depending
on what you are doing and your clients. And, if all your clients have WMI,
you can monitor and even push out modifications. I used this to push out
patches before discovering SUS. The code I used could be used to push out
just about anything.

-- 
Richard
Microsoft MVP Scripting and ADSI
HilltopLab web site - http://www.rlmueller.net
--


Relevant Pages

  • Re: changing existing local user flag "never expires"
    ... set the flag "password never expires". ... A non-zero result means that the flag is ... which means that the script results in the flag not being ... If (lngFlags And ADS_UF_DONT_EXPIRE_PASSWD) = 0 Then ...
    (microsoft.public.scripting.vbscript)
  • Go to related records then find a subset
    ... my deepest condolences for what it is happening today in London. ... Find script step that includes all the desired parameters + the flag ... showing the records, I need to reset the flag field, so that it is ...
    (comp.databases.filemaker)
  • Re: VBscript to set the inherit permissions in registry
    ... propogate to this object" on a workstation from a script. ... Dim objUser, objNtSecurityDescriptor, intNtSecurityDescriptorControl ... ' Save control settings in the security descriptor object. ... As with all flag settings, you "And" the property with the appropriate bit ...
    (microsoft.public.scripting.vbscript)
  • Re: Startup Script install software
    ... I granted the computer account everything but full permissions. ... the startup script so I can use the local system rights for the install, ... My script works if you run it manually so I ... It does allow my script to create a flag in ...
    (microsoft.public.windows.server.active_directory)
  • Re: how to call a function when somebody click a link?
    ... and the php script call the function only if the flag is set:) ... //we want user to go on this page and to add a flag which cause PHP to ... data's been sent to client's browser. ...
    (comp.lang.php)