#129700 - 2004-11-17 02:45 PM
Run part of script only on first Monday of month
|
CJD
Fresh Scripter
Registered: 2004-11-02
Posts: 11
|
As the title says, I need to run part of my logon script ONLY on the first Monday of each month (for auditing PCs). Here's what runs right now, and the scheduling is done by the settings in the exe file. IF INGROUP("Domain Users") RUN '\\server\xxx.exe' ?Audit is running in the background" ENDIF
However, the settings for the audit program don't allow you to specifiy something as specific as the first Monday of the month. If anyone has an example of something similar they would like to share, it would really help out. Thanks.
|
Top
|
|
|
|
#129710 - 2004-11-17 04:23 PM
Re: Run part of script only on first Monday of month
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
ok,
back to the problem ... implementing Les' suggestion, how about this :
Code:
$sFlagKey = "HKEY_CURRENT_USER\Software\KiXtart\"
if @wdayno = 3 and @mdayno < 8 and not val(readvalue($sFlagKey, "FirstMondayFlag")) ;run your shtuff here! if @error = 0 ; or whatever it takes $_ = writevalue($sFlagKey, "FirstMondayFlag", 1, "REG_DWORD") endif else $_ = writevalue($sFlagKey, "FirstMondayFlag", 0, "REG_DWORD") endif
_________________________
|
Top
|
|
|
|
#129712 - 2004-11-17 04:27 PM
Re: Run part of script only on first Monday of month
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#129713 - 2004-11-18 12:41 AM
Re: Run part of script only on first Monday of month
|
Anonymous
Anonymous
Unregistered
|
Quote:
Of course if one logs on many times on that Monday, it will run at every logon. Better to write a flag in the registry or an INI file or some other method to see if it had run already.
That part I can take care of. There is an option in the settings for the exe that you select that makes it run only once a day. I've been too busy to try implementing any of the suggestions today, but I'll let you guys know what works. Thanks for the help, and keep the suggestions coming.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 259 anonymous users online.
|
|
|