Page 1 of 2 12>
Topic Options
#19307 - 2002-04-01 08:17 PM How do I get rid off error output in my script?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Is there an easy way to get them to not show up
in the console window when the script runs?
I get 2 "0's" at the begining of the script
[from the SetTitle and SetConsole]

And 4 "0's" when I check for the NAV update at the
bottom of the script.

Any hep will be appreciated.

Rocco

;================================================
;(Re)Set Ctrl-C/Break handling.
;================================================
BREAK ON
;================================================
;Setting console window title and making sure
;it is always on top of other windows while open.
;================================================
SetTitle ("School Specialty Login Script")
SetConsole ("ALWAYSONTOP")
;================================================
;Setting Global Variables to be used in the script
;================================================
$NL = Chr(13) + Chr(10)
;================================================
;Beginning of script...
;================================================
? "[ Start SSI Login Script... ]"
;================================================
;Checking for RAS/VPN. RAS/VPN will be greater
;than 0 if it is being used. If true the script
;goes to 'END' and exits without running.
;================================================
:RAS
IF (@RAS > 0)
? "[ You are logging in through VPN/RAS... ]"
? "[ The Login Script will exit without running... ]"
SLEEP 5
GOTO END
ENDIF
;================================================
;Checking for Citrix System Drives. If found
;script goes to 'END' and Exits without running.
;================================================
:CITRIX
IF (%SYSTEMDRIVE% = L:)
? "[ You are logging into a Citrix Server... ]"
? "[ The Login Script will exit without running... ]"
GOTO END
ENDIF
IF (%SYSTEMDRIVE% = M:)
? "[ You are logging into a Citrix Server... ]"
? "[ The Login Script will exit without running... ]"
GOTO END
ENDIF
IF (%SYSTEMDRIVE% = N:)
? "[ You are logging into a Citrix Server... ]"
? "[ The Login Script will exit without running... ]"
GOTO END
ENDIF
;================================================
;Greeting the user
;================================================
? "[ Greetings, @FULLNAME... ]"
? "[ The current Local PC time is ( @TIME )... ]"
;================================================
;Checking for OS. Run WINSET if Windows 95/98 is
;found.
;[ 1 ] = Windows NT [ 2 ] = Windows 9x
;May not have to use WINSET from now on, since
;KixTart will do all the login functions.
;================================================
IF (@INWIN = 1)
? "[ You are running Windows NT... ]"
GOTO LSERV
ELSE
IF (@INWIN = 2)
? "[ You are running Windows 95/98... ]"
; ? "Running WINSET for Win95/98."
; SHELL "winset.exe USERNAME=@USERID"
; SHELL "Winset.exe COMPUTERNAME=@WKSTA"
GOTO LSERV
ENDIF
ENDIF
;================================================
;Setting LOGON Server for location and mapping
;drives to LOGON Server.
;================================================
:LSERV
SELECT
CASE INGROUP ("Mansfield")
$SERVER = "\\MANFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to Users on ( $SERVER )... ]"
USE H: "$SERVER\Users"
? "[ Mapping P: to Public on ( $SERVER )... ]"
USE P: "$SERVER\Public"

SELECT
CASE INGROUP ("Mansfield IT")
? "[ Mapping S: to IT on ( $SERVER )... ]"
USE S: "$SERVER\it"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield SSBIDS")
? "[ Mapping S: to SSBids on ( $SERVER )... ]"
USE S: "$SERVER\SSBids"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield Collections")
? "[ Mapping S: to Collections on ( $SERVER )... ]"
USE S: "$SERVER\Collections"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield PBD")
? "[ Mapping S: to PBD on ( $SERVER )... ]"
USE S: "$SERVER\PBD"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield SSCS")
? "[ Mapping S: to SSCS on ( $SERVER )... ]"
USE S: "$SERVER\SSCS"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield Maintenace")
? "[ Mapping S: to Maintenance on ( $SERVER )... ]"
USE S: "$SERVER\Maintenance"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield Payroll")
? "[ Mapping S: to Payroll on ( $SERVER )... ]"
USE S: "$SERVER\Payroll"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield FE")
? "[ Mapping S: to FE on ( $SERVER )... ]"
USE S: "$SERVER\FE"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield SSHR")
? "[ Mapping R: to SSHR on ( $SERVER )... ]"
USE R: "$SERVER\SSHR"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield Warehouse")
? "[ Mapping S: to Warehouse on ( $SERVER )... ]"
USE S: "$SERVER\Warehouse"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield Frey VM")
? "[ Mapping S: to FREYVM on ( $SERVER )... ]"
USE S: "$SERVER\FREYVM"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield Frey Purch")
? "[ Mapping S: to FREYPURCH on ( $SERVER )... ]"
USE S: "$SERVER\FREYPURCH"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield Frey CS")
? "[ Mapping S: to FreyCS on ( $SERVER )... ]"
USE S: "$SERVER\FreyCS"
ENDSELECT
SELECT
CASE INGROUP ("Mansfield Frey Admin")
? "[ Mapping R: to Freyadmin on ( $SERVER )... ]"
USE R: "$SERVER\Freyadmin"
ENDSELECT
SELECT
CASE INGROUP ("Junebox")
? "[ Mapping H: to Users on ( $SERVER )... ]"
USE H: "$SERVER\JUNusers"
? "[ Mapping P: to Public on ( $SERVER )... ]"
USE P: "$SERVER\Public"
ENDSELECT
IF
EXIST ("C:\ETIME\APPS")
? "[ Mapping X: for ETIME... ]"
USE X: "$SERVER\ETIME"
ENDIF
IF
EXIST ("C:\CFWY")
? "[ Mappig V: for OmniRate... ]"
USE V: "$SERVER\CFOMNIRATE"
ENDIF
GOTO DDM
;================================================
CASE INGROUP ("Appleton")
$SERVER = "\\APPFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to Users on ( $SERVER )... ]"
USE H: "$SERVER\users"
? "[ Mapping P: to Data on ( $SERVER )... ]"
USE P: "$SERVER\Data"
GOTO DDM
;================================================
CASE INGROUP ("Junebox")
$SERVER = "\\APPIIS1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to JUNUsers on ( $SERVER )... ]"
USE H: "$SERVER\JUNusers"
? "[ Mapping P: to General on ( $SERVER )... ]"
USE P: "$SERVER\General"
GOTO DDM
;================================================
CASE INGROUP ("Cary")
$SERVER = "\\CARBDC1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to Users on ( $SERVER )... ]"
USE H: "$SERVER\users"
GOTO DDM
;================================================
CASE INGROUP ("Cedar Falls")
$SERVER = "\\CEDFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to CEDUsers on ( $SERVER )... ]"
USE H: "$SERVER\CEDusers"
? "[ Mapping P: to CEDData on ( $SERVER )... ]"
USE P: "$SERVER\CEDData"
GOTO DDM
;================================================
CASE INGROUP ("Fremont")
$SERVER= "\\FREFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to FREUsers on ( $SERVER )... ]"
USE H: "$SERVER\FREusers"
GOTO DDM
;================================================
CASE INGROUP ("Fresno")
$SERVER = "\\FRSRT1NT"
? "[ Your Logon Server is = ( $SERVER ) ]"
GOTO DDM
;================================================
CASE INGROUP ("Lyons")
$SERVER = "\\LYNFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to LYNUsers on ( $SERVER )... ]"
USE H: "$SERVER\LYNusers"
? "[ Mapping P: to LYNPublic on ( $SERVER )... ]"
USE P: "$SERVER\LYNPublic"
GOTO DDM
;================================================
CASE INGROUP ("Ontario")
$SERVER = "\\ONTFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to ONTUsers on ( $SERVER )... ]"
USE H: "$SERVER\ONTusers"
? "[ Mapping P: to Public on ( $SERVER )... ]"
USE P: "$SERVER\Public"
GOTO DDM
;================================================
CASE INGROUP ("Southeaven")
$SERVER = "\\SOUFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to SOUUsers on ( $SERVER )... ]"
USE H: "$SERVER\SOUusers"
? "[ Mapping P: to SOUData on ( $SERVER )... ]"
USE P: "$SERVER\SOUData"
GOTO DDM
;================================================
CASE INGROUP ("Sportime")
$SERVER = "\\SPTFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to SPTUsers on ( $SERVER )... ]"
USE H: "$SERVER\SPTUsers"
? "[ Mapping P: to SPTPublic on ( $SERVER )... ]"
USE P: "$SERVER\SPTPublic"
? "[ Mapping S: to SPTDepts on ( $SERVER )... ]"
USE S: "$SERVER\SPTDepts"
SELECT
CASE INGROUP ("SPTkp")
? "[ Mapping K: to SPTAPPS on ( $SERVER )... ]"
USE K: "$SERVER\SPTAPPS"
ENDSELECT
GOTO DDM
ENDSELECT
;================================================
;Setting Departmental Drive Mappings...
;================================================
:DDM
SELECT
CASE INGROUP ("Sales Admin")
? "[ Mapping S: to Sales on ( \\appfp1nt )... ]"
USE S: "\\appfp1nt\sales"
ENDSELECT
GOTO CADM
;================================================
;Setting Custom Application Drive Mappings...
;================================================
:CADM
SELECT
CASE INGROUP ("FRX")
? "[ Mapping W: to frx55 on ( \\appsql1nt )... ]"
USE W: "\\appsql1nt\frx55"
ENDSELECT
GOTO AUXSCR
;================================================
;Running AUX Scripts...
;================================================
:AUXSCR
? "[ Running AuditWizard Scanner... ]"
RUN "\\appcitrix1nt\scanners\netlogon\scan32.exe"
;================================================
;[ SHELL ] will run the app and the script will
;pause till the app has finnished before
;continuing.
;[ RUN ] will start the app and the script will
;continue without waiting.
;================================================
;================================================
;Norton Virus Definition Update
;================================================
? "[ Checking for AntiVirus Update... ]"
$NAVFILE = Dir("$SERVER\netlogon\_auxfiles\*.exe")
IF
EXIST ("C:\NAV")
GOTO FVAR
ELSE
MD "C:\NAV"
GOTO FVAR
ENDIF
:FVAR
IF
EXIST ("C:\NAV\$NAVFILE.log")
GOTO NOUPD
ELSE
DEL "C:\NAV\*.log"
OPEN(1,"C:\NAV\$NAVFILE.log",5)
WRITELINE(1,"Your NAV Definitions were updated with.... " + $NL)
WRITELINE(1,"[ $NAVFILE ] at [ @TIME @DATE ]")
CLOSE(1)
? "[ Updating AntiVirus with ( $NAVFILE )... ]"
RUN "$SERVER\netlogon\_auxfiles\$NAVFILE /q"
GOTO END
ENDIF
:NOUPD
? "[ Your AntiVirus Definitions are up to date... ]"
GOTO END
;================================================
;End of Script...
;================================================
:END
? "[ Finish SSI Login Script... ]" + $NL
SLEEP 5
EXIT

[ 03 April 2002, 18:48: Message edited by: Rocco Capra ]
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#19308 - 2002-04-01 08:34 PM Re: How do I get rid off error output in my script?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Rocco,
Welcome to the board. You know, this is a very frequently asked question. You'd think someone would have the answer in the FAQ section. [Wink]

All KiX functions return results. You can either wrap them in IF statements, or assign then to a variable.

$RC = SetConsole ("ALWAYSONTOP")
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#19309 - 2002-04-01 09:56 PM Re: How do I get rid off error output in my script?
Dean B. Offline
Fresh Scripter

Registered: 2002-02-04
Posts: 46
Loc: Allegan, MI USA
As Les mentioned, in your script the functions SetTitle(), SetConsole(), Open(), Close(), and WriteLine() all will return values. You need to capture the result in a variable in order to suppress the value printing on the screen.

If you don't mind, I have reposted your script with the following changes:

* Used indentation to make the CASE SELECT and IF statements more readable.
* Banished almost all of the GOTO statements and their corresponding labels.
* Used Null ($) to capture results of Kixtart functions.

code:
;================================================
;(Re)Set Ctrl-C/Break handling.
;================================================
BREAK ON ; << If you turn on BREAK, it will allow the user to cancel the login script.
;================================================
;Setting console window title and making sure
;it is always on top of other windows while open.
;================================================
$ = SetTitle ("School Specialty Login Script")
$ = SetConsole ("ALWAYSONTOP")
;================================================
;Setting Global Variables to be used in the script
;================================================
$NL = Chr(13) + Chr(10)
;================================================
;Beginning of script...
;================================================
? "[ Start SSI Login Script... ]"
;================================================
;Checking for RAS/VPN. RAS/VPN will be greater
;than 0 if it is being used. If true the script
;goes to 'END' and exits without running.
;================================================
:RAS
IF (@RAS > 0)
? "[ You are logging in through VPN/RAS... ]"
? "[ The Login Script will exit without running... ]"
SLEEP 5
GOTO END
ENDIF
;================================================
;Checking for Citrix System Drives. If found
;script goes to 'END' and Exits without running.
;================================================
:CITRIX
IF (%SYSTEMDRIVE% = L:) or (%SYSTEMDRIVE% = M:) or (%SYSTEMDRIVE% = N:)
? "[ You are logging into a Citrix Server... ]"
? "[ The Login Script will exit without running... ]"
GOTO END
ENDIF
;================================================
;Greeting the user
;================================================
? "[ Greetings, @FULLNAME... ]"
? "[ The current Local PC time is ( @TIME )... ]"
;================================================
;Checking for OS. Run WINSET if Windows 95/98 is
;found.
;[ 1 ] = Windows NT [ 2 ] = Windows 9x
;May not have to use WINSET from now on, since
;KixTart will do all the login functions.
;================================================
IF (@INWIN = 1)
? "[ You are running Windows NT... ]"
ELSE
? "[ You are running Windows 95/98... ]"
; ? "Running WINSET for Win95/98."
; SHELL "winset.exe USERNAME=@USERID"
; SHELL "Winset.exe COMPUTERNAME=@WKSTA"
ENDIF
;================================================
;Setting LOGON Server for location and mapping
;drives to LOGON Server.
;================================================
SELECT
CASE INGROUP ("Mansfield")
$SERVER = "\\MANFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to Users on ( $SERVER )... ]"
USE H: "$SERVER\Users"
? "[ Mapping P: to Public on ( $SERVER )... ]"
USE P: "$SERVER\Public"

SELECT
CASE INGROUP ("Mansfield IT")
? "[ Mapping S: to IT on ( $SERVER )... ]"
USE S: "$SERVER\it"
CASE INGROUP ("Mansfield SSBIDS")
? "[ Mapping S: to SSBids on ( $SERVER )... ]"
USE S: "$SERVER\SSBids"
CASE INGROUP ("Mansfield Collections")
? "[ Mapping S: to Collections on ( $SERVER )... ]"
USE S: "$SERVER\Collections"
CASE INGROUP ("Mansfield PBD")
? "[ Mapping S: to PBD on ( $SERVER )... ]"
USE S: "$SERVER\PBD"
CASE INGROUP ("Mansfield SSCS")
? "[ Mapping S: to SSCS on ( $SERVER )... ]"
USE S: "$SERVER\SSCS"
CASE INGROUP ("Mansfield Maintenace")
? "[ Mapping S: to Maintenance on ( $SERVER )... ]"
USE S: "$SERVER\Maintenance"
CASE INGROUP ("Mansfield Payroll")
? "[ Mapping S: to Payroll on ( $SERVER )... ]"
USE S: "$SERVER\Payroll"
CASE INGROUP ("Mansfield FE")
? "[ Mapping S: to FE on ( $SERVER )... ]"
USE S: "$SERVER\FE"
CASE INGROUP ("Mansfield SSHR")
? "[ Mapping R: to SSHR on ( $SERVER )... ]"
USE R: "$SERVER\SSHR"
CASE INGROUP ("Mansfield Warehouse")
? "[ Mapping S: to Warehouse on ( $SERVER )... ]"
USE S: "$SERVER\Warehouse"
CASE INGROUP ("Mansfield Frey VM")
? "[ Mapping S: to FREYVM on ( $SERVER )... ]"
USE S: "$SERVER\FREYVM"
CASE INGROUP ("Mansfield Frey Purch")
? "[ Mapping S: to FREYPURCH on ( $SERVER )... ]"
USE S: "$SERVER\FREYPURCH"
CASE INGROUP ("Mansfield Frey CS")
? "[ Mapping S: to FreyCS on ( $SERVER )... ]"
USE S: "$SERVER\FreyCS"
CASE INGROUP ("Mansfield Frey Admin")
? "[ Mapping R: to Freyadmin on ( $SERVER )... ]"
USE R: "$SERVER\Freyadmin"
CASE INGROUP ("Junebox")
? "[ Mapping H: to Users on ( $SERVER )... ]"
USE H: "$SERVER\JUNusers"
? "[ Mapping P: to Public on ( $SERVER )... ]"
USE P: "$SERVER\Public"
ENDSELECT

IF EXIST ("C:\ETIME\APPS")
? "[ Mapping X: for ETIME... ]"
USE X: "$SERVER\ETIME"
ENDIF
IF EXIST ("C:\CFWY")
? "[ Mappig V: for OmniRate... ]"
USE V: "$SERVER\CFOMNIRATE"
ENDIF
;================================================
CASE INGROUP ("Appleton")
$SERVER = "\\APPFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to Users on ( $SERVER )... ]"
USE H: "$SERVER\users"
? "[ Mapping P: to Data on ( $SERVER )... ]"
USE P: "$SERVER\Data"
;================================================
CASE INGROUP ("Junebox")
$SERVER = "\\APPIIS1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to JUNUsers on ( $SERVER )... ]"
USE H: "$SERVER\JUNusers"
? "[ Mapping P: to General on ( $SERVER )... ]"
USE P: "$SERVER\General"
;================================================
CASE INGROUP ("Cary")
$SERVER = "\\CARBDC1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to Users on ( $SERVER )... ]"
USE H: "$SERVER\users"
;================================================
CASE INGROUP ("Cedar Falls")
$SERVER = "\\CEDFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to CEDUsers on ( $SERVER )... ]"
USE H: "$SERVER\CEDusers"
? "[ Mapping P: to CEDData on ( $SERVER )... ]"
USE P: "$SERVER\CEDData"
;================================================
CASE INGROUP ("Fremont")
$SERVER= "\\FREFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to FREUsers on ( $SERVER )... ]"
USE H: "$SERVER\FREusers"
;================================================
CASE INGROUP ("Fresno")
$SERVER = "\\FRSRT1NT"
? "[ Your Logon Server is = ( $SERVER ) ]"
;================================================
CASE INGROUP ("Lyons")
$SERVER = "\\LYNFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to LYNUsers on ( $SERVER )... ]"
USE H: "$SERVER\LYNusers"
? "[ Mapping P: to LYNPublic on ( $SERVER )... ]"
USE P: "$SERVER\LYNPublic"
;================================================
CASE INGROUP ("Ontario")
$SERVER = "\\ONTFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to ONTUsers on ( $SERVER )... ]"
USE H: "$SERVER\ONTusers"
? "[ Mapping P: to Public on ( $SERVER )... ]"
USE P: "$SERVER\Public"
;================================================
CASE INGROUP ("Southeaven")
$SERVER = "\\SOUFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to SOUUsers on ( $SERVER )... ]"
USE H: "$SERVER\SOUusers"
? "[ Mapping P: to SOUData on ( $SERVER )... ]"
USE P: "$SERVER\SOUData"
;================================================
CASE INGROUP ("Sportime")
$SERVER = "\\SPTFP1NT"
? "[ Your Logon Server is = ( $SERVER )... ]"
? "[ Mapping H: to SPTUsers on ( $SERVER )... ]"
USE H: "$SERVER\SPTUsers"
? "[ Mapping P: to SPTPublic on ( $SERVER )... ]"
USE P: "$SERVER\SPTPublic"
? "[ Mapping S: to SPTDepts on ( $SERVER )... ]"
USE S: "$SERVER\SPTDepts"
SELECT
CASE INGROUP ("SPTkp")
? "[ Mapping K: to SPTAPPS on ( $SERVER )... ]"
USE K: "$SERVER\SPTAPPS"
ENDSELECT
ENDSELECT
;================================================
;Setting Departmental Drive Mappings...
;================================================
SELECT
CASE INGROUP ("Sales Admin")
? "[ Mapping S: to Sales on ( \\appfp1nt )... ]"
USE S: "\\appfp1nt\sales"
ENDSELECT
;================================================
;Setting Custom Application Drive Mappings...
;================================================
SELECT
CASE INGROUP ("FRX")
? "[ Mapping W: to frx55 on ( \\appsql1nt )... ]"
USE W: "\\appsql1nt\frx55"
ENDSELECT
;================================================
;Running AUX Scripts...
;================================================
? "[ Running AuditWizard Scanner... ]"
RUN "\\appcitrix1nt\scanners\netlogon\scan32.exe"
;================================================
;[ SHELL ] will run the app and the script will
;pause till the app has finnished before
;continuing.
;[ RUN ] will start the app and the script will
;continue without waiting.
;================================================
;================================================
;Norton Virus Definition Update
;================================================
? "[ Checking for AntiVirus Update... ]"
$NAVFILE = Dir("$SERVER\netlogon\_auxfiles\*.exe")
IF EXIST ("C:\NAV") = 0
MD "C:\NAV"
ENDIF
IF EXIST ("C:\NAV\$NAVFILE.log") = 0
DEL "C:\NAV\*.log"
$ = OPEN(1,"C:\NAV\$NAVFILE.log",5)
$ = WRITELINE(1,"Your NAV Definitions were updated with.... " + $NL)
$ = WRITELINE(1,"[ $NAVFILE ] at [ @TIME @DATE ]")
$ = CLOSE(1)
? "[ Updating AntiVirus with ( $NAVFILE )... ]"
RUN "$SERVER\netlogon\_auxfiles\$NAVFILE /q"
GOTO END
ELSE
? "[ Your AntiVirus Definitions are up to date... ]"
ENDIF
;================================================
;End of Script...
;================================================
:END
? "[ Finish SSI Login Script... ]" + $NL
SLEEP 5 ; << Do you really want to make your users wait this long? :)
EXIT

Please test this if you are going to use it. I hope this helps!
_________________________
Dean

Top
#19310 - 2002-04-01 10:29 PM Re: How do I get rid off error output in my script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Using '$=SetTitle("School Specialty Login Script")' is a big NO-NO. The '$' character is a reserved character if you so will. Anyway, always assign a properly formatted variable name and do not use '$' as a variable name. Therefore, it sound be '$retcode=SetTitle("School Specialty Login Script")'
_________________________
There are two types of vessels, submarines and targets.

Top
#19311 - 2002-04-02 01:24 AM Re: How do I get rid off error output in my script?
Dean B. Offline
Fresh Scripter

Registered: 2002-02-04
Posts: 46
Loc: Allegan, MI USA
Jens -

Thanks for the info. I've seen code on the BB using this format.

Rocco -
You will want to know the value of the variable for checking the success or failure of the functions.
_________________________
Dean

Top
#19312 - 2002-04-02 01:53 AM Re: How do I get rid off error output in my script?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
As soon as I get back to work tomarrow I'll try this stuff out.

Um the "sleep 5" is there for testing only the script is not being used by the users yet. I have a bat file for each "Group" right now and it gets messy, that's why I made this one file in KIX for all users.

Oh and the original file has tabulation in it (TextPad). It just removed the tabs when I copied and pasted it in the post.

Rocco

[ 02 April 2002, 01:55: Message edited by: Rocco Capra ]
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#19313 - 2002-04-02 02:18 AM Re: How do I get rid off error output in my script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Dean:

It's just a bad programming practice and might lead to problems. I believe in proper coding to prevent errors in the first place. Additionally, if you are using a dummy variable like $dummy or $retcode then you know that it is a dummy variable when you reread your code six months after writing it.
_________________________
There are two types of vessels, submarines and targets.

Top
#19314 - 2002-04-02 02:41 AM Re: How do I get rid off error output in my script?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Why is $= a bad thing ?

-Shawn

Top
#19315 - 2002-04-02 04:30 AM Re: How do I get rid off error output in my script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
The '$' sign is the indicator for a variable, it is not a variable itself. Thus one shouldn't be able to use it as a variable. Also, if '$' is a variable , then
code:
$aa='abcabc'
$='bb'
? "$aa"

might have two meanings. The output could be either
code:
bbaa

or
code:
abcabc

Not knowing how the inner workings of Kixtart are I think it is safer to not use '$' as a variable to prevent potential problems. I am sure Ruud will be able to give us the definite answer on how '$' as a variable would affect Kixtart scripts.
_________________________
There are two types of vessels, submarines and targets.

Top
#19316 - 2002-04-02 04:53 AM Re: How do I get rid off error output in my script?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Isn't $ a variable ?

-Shawn [Wink]

I'm just pulling your chain there Jens. I know $= isn't best practice (there are other problems with it as well). Maybe I'm just making excuses for my own terrible coding style [Wink]

[ 02 April 2002, 05:10: Message edited by: Shawn ]

Top
#19317 - 2002-04-02 05:19 AM Re: How do I get rid off error output in my script?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
OR maybe you're just trying to raise your post count? [Wink]
Top
#19318 - 2002-04-02 06:29 AM Re: How do I get rid off error output in my script?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jens,
Shawn's jerking yer chain fer sure. It was he and someone (who, I can't remember) that taught me $ is a valid variable. I couldn't find the thread so will reiterate. A simple snippet of code like this will confirm:

break on
$="test"
$ ?
"\\Server\Users\@UserID$" ?
"\\Server\Users\@UserID$$" ?
get $_

IF you assign a string or value to $, then if you use sloppy coding for say, hidden shares, it will give you grief. If $ is assigned as a string, then:

Use "H:" "\\Server\Users\@UserID$"

Would concatenate the @UserID and the $ as if it were:

"\\Server\Users\" + @UserID + $

The manual states that if a $ is used within quotes that it should be $$, as in:

Use "H:" "\\Server\Users\@UserID$$"
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#19319 - 2002-04-02 07:55 AM Re: How do I get rid off error output in my script?
Anonymous
Unregistered


I think a lot of questions might be cleared up with the $= topic by looking at Ruud's responses to my questions posted over on the KiXtart forum at www.scriptlogic.com

Specifically...
http://www.scriptlogic.com/support/forums/display_message.asp?mid=2525

Top
#19320 - 2002-04-02 07:59 AM Re: How do I get rid off error output in my script?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Les,

Let's see here two FAQs.. You are doing good here.

(1) How to suppress results from SETITLE, WRITEPROFILESTRING, WRITELINE, etc.?
(2) What makes a good variable, when it is not used, but we still need to supress the results?

Thanks!

- Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#19321 - 2002-04-02 09:50 AM Re: How do I get rid off error output in my script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
brian, indeed that discussion is what i've been thinking of...
actually I were wondering before that behaviour of kix accepting $-variable and thought that it must be kind off null pointer and have threated it as one since then (some 5 months now).

and as such I do not see it bad coding at all, vise versa.

cheers all goodfellas,
_________________________
!

download KiXnet

Top
#19322 - 2002-04-02 11:44 AM Re: How do I get rid off error output in my script?
Schuliebug Offline
Hey THIS is FUN
*****

Registered: 2002-01-18
Posts: 379
Loc: Netherlands
I've encountered some problems using $=.. as a NULL pointer ! Since then i'm suing $RC as default return value. As i remember it had something to do with returnvalues being set by a function, redirected to $=, but seemed to be used in a following expression [Frown]
_________________________
Kind regards,

Top
#19323 - 2002-04-03 12:01 AM Re: How do I get rid off error output in my script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
about it being used in following expression points to same thing les was talking about.
about using $-sign in expression or string...
which then is also bad coding, something that manual is against and as so wrong.
when used as null pointer, it's just undocumented not wrong.

am I right?
and even thou I might not be, I could throw my 300cent(meter)s...

sjdhjklyf,
_________________________
!

download KiXnet

Top
#19324 - 2002-04-02 03:11 PM Re: How do I get rid off error output in my script?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I agree with Lonkero, I love the $= and have been using it way too long to stop now. I think it makes code less cluttered and a bit easier to read (imho). Plus the fact that our production scripts are riddled with it`s usage. Sure, it may be a bit of a loaded gun, but if one appreciates and understands the mechanism (and the dangers), no bad will happen. For someone starting with a clean slate - I`d probably discourage the usage.

-Shawn

Top
#19325 - 2002-04-02 03:56 PM Re: How do I get rid off error output in my script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Wow, cool discussion. Didn't expect this. Anyway, thanks to everybody for the very educational responses.
After reading this discussion, I'd like to propose a new topic called 'Good Programming Practices in Kixtart'. I'm sure we're going to agree to disagree on some programming styles but it might be a very educational exercise.
_________________________
There are two types of vessels, submarines and targets.

Top
#19326 - 2002-04-03 05:45 AM Re: How do I get rid off error output in my script?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Les,

You know what? This is in the FAQ...

Check this out:

Debugging without user input..

Later,

- Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 262 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.073 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

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