Page 1 of 1 1
Topic Options
#551 - 1999-09-30 05:34 PM Trying to Install a Patch During Login
Anonymous
Unregistered


I'm trying to create a login script that will allow a patch to be installed during login. It starts off...

CLS
?

$Selection = ExistKey ("I enter registry key here")

IF $Selection = 0
? "Key exists. System already updated."
Exit
ELSE
MESSAGEBOX ("Your system will now be updated with the xxx patch.", "Patch Install", 0, 20)
RUN "patch.exe"
ENDIF

SLEEP 15

CLS

; so far it works great up to here

$ReturnCode = ExistKey ("I enter registry key here")

IF $ReturnCode = 0
? "Key has been updated."
EXIT
ELSE
? "Your system has not been updated. It will now logoff."
SLEEP 3
LOGOFF (1)
ENDIF

EXIT


That's it. As previously stated, it runs great up to the second CLS but every single time it runs the commands for the ELSE in the second IF...ELSE statement (even if the patch was loaded). I have been unsuccessful in using the debugger, probably because I'm not using it properly. I've tried to run it with the /d option but nothing. What am I doing wrong, other than not reading enough of Kixtart? I would be GREATLY appreciated if you can pass along the answers or any suggestion/advice. Thank you for the attention.

Top
#552 - 1999-10-05 12:40 AM Re: Trying to Install a Patch During Login
Anonymous
Unregistered


Running programs means they will spawn off new processes. This can get really messy when you need to continue processing a script after the program completes. The solution to your problem is to use the shell command instead. Shell will wait for the execution to complete before returning control to your script. Example:


Shell "%comspec% /e:1024 /c patch.exe"
; no sleep command needed
; more commands

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 709 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.047 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org