|
KiXtart version: 4.61, Win XP SP3. Using wkix32.exe with -i running tokenized scripts.
Scenario: I wrote a simple script that checks for a VPN connection to the company network once per minute. When it detects that the VPN has just been connected, it calls a sub script that checks the user's password age and notifies the user if expiration will occur in < 8 days or the password has already expired.
Problem: The master script runs full time. Once the script has run and detected expiration is < 8 days, the value of @PWAGE seems to be cached by KiXtart. Testing on later days always return the same value for @PWAGE.
Fire a new instance of wkix32.exe with the same script and voila, the correct value for @PWAGE is detected.
Anyone ever seen this? Any suggestions? The only thing I can come up with is to fire a separate script in another instance of wkix32.exe using SHELL instead of using a CALL in the master script.
Note: all variables shown below are dim'd in the called subscript. Global variables are not used.
$PWExpire = 0 $PWDAYSOLD = 0
$PWDAYSOLD = @PWAGE $PWExpire = 31 - $PWDAYSOLD
If $PWExpire < 8 $TextInMessage = "The password for your " + $UserDomain + " user account " + $DomainUsername + " will expire in " + $PWExpire + " days." + CHR(10) + CHR(10) + "To change your password, press <CTRL> <ALT> <DEL> and select Change Password" + " with your VPN client connected." $MsgToDeliver = 1 GoTo POSTMSG EndIf
|