#189926 - 2008-09-29 02:56 AM
Re: Putting it all together.....
[Re: Mart]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
Absolutely! You MUST declare all the variables in your script if you are going to CALL it from my login script. If you used SHELL, it would not matter, but with CALL, all of the variables, functions, and process option settings defined in the main script will be in effect for your scripts.
Please review the README.TXT file for a detailed list of variables and functions that are defined in the login script. I'll update it to also reflect the SetOption settings, but for now, Explicit, NoVarsInStrings, and NoMacrosInStrings are all ON. You can freely use the "$" instead of "$RC" as a "throwaway" var if you wish.
For debug logging in your script, do the following:
$DEBUG=1 ; turn on debug mode to allow debug messages to be displayed/written
; your script commands...
Dbg('About to do something...') ; write a message to the debug log
;more script commands...
$DEBUG=0 ; turn debug mode back off before returning to the login script
Exit 0 ; end your script The Dbg() function writes to %USERPROFILE%\LoginDebug.log, where all other debugging output from the login script process can be found. You should not write to C:\, as secure XP systems, and most Vista and W2K8 systems will not allow writing to the root of C:, and you'll lose your logging info. This is one of the benefits of CALLing a script - all the functions used by the login script are available to your script, too.
DO NOT set the break value in your script - it's handled by the login script! It's OK for testing, but scripts CALLed from the login script in production should not modify the break setting. I didn't see it in your example, but it was in Mart's, so I just want to be clear about its use with my login script.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 293 anonymous users online.
|
|
|