#81942 - 2002-04-03 06:07 AM
Suppressing Results when running scripts
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Hiding results.. How do we turn off all of the 0,1,2 's etc. when we run our script?
IF @dos >= 5.0 $hklms = $HKLMS = 'HKEY_LOCAL_MACHINE\SOFTWARE' IF 1 <> ReadValue($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync") WriteValue ($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync", "1", "REG_DWORD") ENDIF ENDIF
If you run the above script, you will see a Zero "0". What is this all about? It is to show you a success (0) or failure (error code) of when you write to the registry or other operation within Kix. This is an ideal practice for debugging your scripts when working on them.
IF @dos >= 5.0 $hklms = $HKLMS = 'HKEY_LOCAL_MACHINE\SOFTWARE' IF 1 <> ReadValue($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync") $Dummy = WriteValue ($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync", "1", "REG_DWORD") ENDIF ENDIF
If you run the above, it will suppress or hide the result.
So, what about $dummy or $rc or $returncode? These can be used in the same context as a simple $, however the $ maybe more difficult to debug code at a later point in time.
What are some of the functions that return values? (This is partial list)..
- DELTREE (Registry Editing)
- ENUMLOCALGROUP (Domain/Network Function)
- ENUMVALUE (Registry Function)
- EXIST (File Function)
- EXISTKEY (Registry Function)
- INGROUP (Domain/Network Function)
- INSTR (Text String Manipulation)
- LOADHIVE (Registry Editing)
- LOADKEY (Registry Editing)
- OPEN (Text File Function)
- READLINE (Text File Function)
- READPROFILESTRING (INI File Function)
- READVALUE (Registry Editing)
- SETFILEATTR (File Function)
- SETFOCUS (Program Function)
- SETSYSTEMSTATE (System Function)
- SETWALLPAPER (System Function)
- SHOWPROGRAMGROUP (System Function)
- SHUTDOWN (System Function)
- UNLOADHIVE (Registry Editing)
- WRITELINE (Text Editing)
- WRITEPROFILESTRING (INI Editing)
- WRITEVALUE (Registry Editing)
[ 03 April 2002, 06:12: Message edited by: kdyer ]
|
Top
|
|
|
|
Suppressing Results when running scripts
|
Kdyer
|
2002-04-03 06:07 AM
|
|
Moderator: Jochen, Radimus, Glenn Barnas, Allen, Arend_, ShaneEP, Mart
|
0 registered
and 530 anonymous users online.
|
|
|