Page 1 of 1 1
Topic Options
#165593 - 2006-08-08 11:30 PM Error: error in USE Statement!
Suzanne Offline
Lurker

Registered: 2006-08-08
Posts: 3
I am receiving this message when our users are logging onto to the network:

ERROR: error in USE statement!
Script: \\maindc1\Netlogon\kixtart.kix
line ;82

Below is a current copy of our Kix Script. I had made some changes in the script because we have retired some of our servers and have moved files and programs to new servers. We are currently running Server 2003 and the Kix is Kixtart 2001. I made changes earlier in the summer to our kix script for two of the schools' new servers and did not receive this message. On the particular line 82 that is giving me this error, I have no changes to this part of the script. I'm fairly new at KIX but I have made changes in the past and have not received these errors...

We are also running this particular script through Active Directory Users and computers.

Thanks
Suzanne McClelland
Page Unified School District #8

here is the copy of our kix script:
Code:

; KIXTART.KIX
;
; Logon Script for entire District
;
;
; Author: Denise Hatcher
; Creation Date: 04-11-03
; Modified by: Suzanne McClelland
; Date Modified: 08-03-06
; ***** Notice always put quotes around UNC's with a $ in it. ***
;
;
;
;-------------- Mappings for H:Drive -----------------
;
;------------------ Set Variables ---------------------

$Admin="\\Admin\"
$Tech2="\\Tech2\"
$Sanddevil2="\\SandDevil2\"
$Sanddevil3="\\SandDevil3\"

$Panthers2="\\Panthers2\"
$Panthers3="\\Panthers3\"


$Bobcats2="\\Bobcats2\"
$Bobcats3="\\Bobcats3\"

$Eagles2="\\Eagles2\"
$Eagles3="\\Eagles3\"


$username=@userid
$extension="$"
$machinename=SUBSTR(@wksta,1,2)


;---------- Set Group Var based on Users home site ------------

IF INGROUP("UsersHS")
$SiteServer=$Sanddevil3
$SiteExt="HS"ENDIF

IF INGROUP("UsersMS")
$SiteServer=$Panthers3
$SiteExt="MS"
ENDIF

IF INGROUP("UsersLV")
$SiteServer=Eagles3
$SiteExt="LV"
ENDIF

IF INGROUP("UsersDV")
$SiteServer=$Bobcats3
$SiteExt="DV"
ENDIF

IF INGROUP("UsersDO")
$SiteServer=$Admin
$SiteExt="DO"
ENDIF

IF INGROUP("Domain Admins")
$SiteServer=$Tech2
$SiteExt="TE"
ENDIF

$HomeDir=$SiteServer+$UserName+$Extension

USE H: $HomeDir

;
;-------------- Mappings based on Member Groups -----------------
;The next area is used to connect to network resources and
;File shares based on group the User is a Member of.
;
;
;------------------All SASI Mappings -----------------

IF INGROUP("SASI")
USE P: "\\Panthers\SasiXP$"
USE Q: "\\Bobcats\SasiXP$"
USE R: "\\Eagles\SasiXP$"
USE S: "\\SandDevil\SasiXP$"

Copy "\\sanddevil\DISasi$\SASI-S~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"

ENDIF

; ---------------- Technology ------------

IF INGROUP("Domain Admins")
USE F: "\\Tech2\APPS$"
USE I: "\\Tech2\Images$"
USE J: "\\Bobcats3\Images$"
USE K: "\\Eagles3\Images$"
USE L: "\\Panthers\Images$"
USE M: "\\SandDevil3\Images$"
USE N: "\\Tech2\Nas$"

ENDIF

; ----------------District Office------------

IF INGROUP("UsersDO")
USE F: "\\Admin\APPS"
ENDIF

IF INGROUP("DOCommon")
USE I: "\\Admin\DO$"
ENDIF

IF INGROUP("HRCommon")
USE J: "\\Admin\HR$"
ENDIF

IF INGROUP("PerformNow")
USE V: "\\Admin\SecureApps$"
ENDIF

IF INGROUP("Administration")
USE G: "\\Admin\DOAdmin$"
ENDIF


;------------------ EdServices Mappings ---------------------

IF INGROUP("IEPProviders")
USE I: "\\Admin\IEPProviders$"
ENDIF

IF INGROUP("EdServices")
USE Y: "\\Admin\EdServices$"
ENDIF

;IF INGROUP("IEPProviders") AND EXIST ("C:\AdobeYes.txt")=0
; RUN "\\tech\eXpress\rinstall\AdobeFull.exe -nr"
; COPY "\\tech\eXpress\rinstall\AdobeYes.txt" "C:\"
; ELSE
;ENDIF

;------------------ Cafe Mappings ---------------------

IF INGROUP("Cafeteria")
USE E: "\\admincafe\cafeterm"
USE X: "\\Admincafe\USDA"
USE Y: "\\admincafe\foodco6$"
ENDIF

;------------------ Transportation Mappings ---------------

IF INGROUP("Transportation")
USE T: "\\Admin\Trans$"
ENDIF

; ---------------- High School Drive Mappings ------------

IF INGROUP("UsersHS")
USE F: "\\SandDevil3\APPS"
USE U: "\\SandDevil\SearchPlus$"

Copy "F:\HSCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("SasiHS")
USE S: "\\SandDevil\SasiXP$"

Copy "F:\HSCDTwr\ATTEND~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("UsersHS") AND INGROUP("Teachers")
USE G: "\\SandDevil3\HSTeachers$"
ENDIF

IF INGROUP("UsersHS") AND INGROUP("Librarians")
USE T: "\\SandDevil\TextLink$"
ENDIF

;------------------Middle School Drive Mappings ---------------------

IF INGROUP("UsersMS")
USE F: "\\PANTHERS2\APPS"
USE U: "\\PANTHERS\SearchPlus$"

Copy "F:\MSCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("SasiMS")
USE S: "\\Panthers\SasiXP$"

Copy "F:\MSCDTwr\ATTEND~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("UsersMS")AND INGROUP("Teachers")
USE G: "\\panthers3\MSTeachers$"
ENDIF

IF INGROUP("UsersMS") AND INGROUP("Librarians")
USE T: "\\PANTHERS\TextLink$"
ENDIF

IF INGROUP("CCC")
USE M: "\\MSPAGE_CCC\CAI1"
USE N: "\\MSPAGE_CCC\CAI2"
USE O: "\\MSPAGE_CCC\CAI3"
USE S: "\\MSPAGE_CCC\History"
ENDIF

; ----------------Desert View Drive Mappings------------
IF INGROUP("UsersDV")
USE F: "\\BOBCATS3\APPS"
USE O: "\\bobcats\RnseServer$"
USE U: "\\bobcats\SearchPlus$"

Copy "F:\DVCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
Copy "F:\DVCDTwr\ARR6ST~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("SasiDV")
USE S: "\\Bobcats\SasiXP$"

Copy "F:\DVCDTwr\ATTEND~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("UsersDV") AND INGROUP("Teachers")
USE G: "\\bobcats3\DVTeachers$"
USE O: "\\bobcats\RnseServer$"

Copy "F:\DVCDTwr\ARR6TE~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

; ----------------Lake View Drive Mappings------------
IF INGROUP("UsersLV")
USE F: "\\EAGLES3\APPS"
USE U: "\\EAGLES\SearchPlus$"

USE I: "\\EAGLES\CDROM-1$"
USE J: "\\EAGLES\CDROM-2$"
USE K: "\\EAGLES\CDROM-3$"
USE L: "\\EAGLES\CDROM-4$"
USE M: "\\EAGLES\CDROM-5$"
USE N: "\\EAGLES\CDROM-6$"

Copy "F:\LVCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
Copy "F:\LVCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("SasiLV")
USE S: "\\Eagles\SasiXP$"

Copy "F:\LVCDTwr\ATTEND~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("UsersLV") AND INGROUP("Teachers")
USE G: "\\eagles3\LVTeachers$"
ENDIF

;------------------All Users Mappings -----------------
;IF INGROUP("DomainUsers")
;
; Copy "http://www.pageud.k12.az.us/HelpDesk/index.htm" "C:\Documents and Settings\" + $username + "\Desktop"
;
;ENDIF
;
:END
EXIT



Edited by Howard Bullock (2006-08-09 05:25 AM)

Top
#165594 - 2006-08-08 11:46 PM Re: Error: error in USE Statement!
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
It would be easier if you told us where line 82 was rather than make us count lines. CODE tags would be nice too.

You are missing a return on:
Code:
IF INGROUP("UsersHS")
$SiteServer=$Sanddevil3
$SiteExt="HS"ENDIF


Top
#165595 - 2006-08-08 11:54 PM Re: Error: error in USE Statement!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
line 82 in the given code is:
IF INGROUP("SASI")


so, the given code is not the same as the erroring one.

Top
#165596 - 2006-08-09 12:36 AM Re: Error: error in USE Statement!
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Quote:


$HomeDir=$SiteServer+$UserName+$Extension









USE H: $HomeDir




Maybe it was about line 72
Maybe line 70 should be
Code:

$HomeDir = "\\" + $SiteServer + "\" + $UserName + $Extension


Top
#165597 - 2006-08-09 01:55 AM Re: Error: error in USE Statement!
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
$SiteServer already has the hacks.
Top
#165598 - 2006-08-09 01:59 AM Re: Error: error in USE Statement!
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Agree with Witto that it is probably falling apart there. Maybe due to lack of membership as well.

Minor re-write. Missed a couple items and I would use
this at the top of the script and correct the script
to stop any errors due to these settings.

Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')


;  KIXTART.KIX 
;
; Logon Script for entire District
;
;
; Author: Denise Hatcher
; Creation Date: 04-11-03
; Modified by: Suzanne McClelland
; Date Modified: 08-03-06
; ***** Notice always put quotes around UNC's with a $ in it. ***
;
;
;
;-------------- Mappings for H:Drive -----------------
;
;------------------ Set Variables ---------------------

Dim $Admin, $Tech2, $Sanddevil2, $Sanddevil3, $Panthers2, $Panthers3
Dim $Bobcats2, $Bobcats3, $Eagles2, $Eagles3
Dim $extension, $machinename, $SiteServer, $SiteExt, $username, $HomeDir

$Admin="\\Admin\"
$Tech2="\\Tech2\"
$Sanddevil2="\\SandDevil2\"
$Sanddevil3="\\SandDevil3\"

$Panthers2="\\Panthers2\"
$Panthers3="\\Panthers3\"


$Bobcats2="\\Bobcats2\"
$Bobcats3="\\Bobcats3\"

$Eagles2="\\Eagles2\"
$Eagles3="\\Eagles3\"

;No need to declare a var for a macro, the macro is as fast or faster than the var call
$username=@userid
;Would recommend not using $ like this. Just place $ when, where needed.
$extension="$"
$machinename=SUBSTR(@wksta,1,2)


;---------- Set Group Var based on Users home site ------------

IF INGROUP("UsersHS")
$SiteServer=$Sanddevil3
$SiteExt="HS"
ENDIF

IF INGROUP("UsersMS")
$SiteServer=$Panthers3
$SiteExt="MS"
ENDIF

IF INGROUP("UsersLV")
$SiteServer=Eagles3
$SiteExt="LV"
ENDIF

IF INGROUP("UsersDV")
$SiteServer=$Bobcats3
$SiteExt="DV"
ENDIF

IF INGROUP("UsersDO")
$SiteServer=$Admin
$SiteExt="DO"
ENDIF

IF INGROUP("Domain Admins")
$SiteServer=$Tech2
$SiteExt="TE"
ENDIF

;If user is not found in a group this path will never be correct
$HomeDir=$SiteServer+$UserName+$Extension

USE H: $HomeDir

;
;-------------- Mappings based on Member Groups -----------------
;The next area is used to connect to network resources and
;File shares based on group the User is a Member of.
;
;
;------------------All SASI Mappings -----------------

IF INGROUP("SASI")
USE P: "\\Panthers\SasiXP$"
USE Q: "\\Bobcats\SasiXP$"
USE R: "\\Eagles\SasiXP$"
USE S: "\\SandDevil\SasiXP$"

;Not the best method to copy to the users desktop.
;Either use the environment %USERNAME% or do a registry read
Copy "\\sanddevil\DISasi"+"$"+"\SASI-S~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"

ENDIF

; ---------------- Technology ------------

IF INGROUP("Domain Admins")
USE F: "\\Tech2\APPS$"
USE I: "\\Tech2\Images$"
USE J: "\\Bobcats3\Images$"
USE K: "\\Eagles3\Images$"
USE L: "\\Panthers\Images$"
USE M: "\\SandDevil3\Images$"
USE N: "\\Tech2\Nas$"

ENDIF

; ----------------District Office------------

IF INGROUP("UsersDO")
USE F: "\\Admin\APPS"
ENDIF

IF INGROUP("DOCommon")
USE I: "\\Admin\DO$"
ENDIF

IF INGROUP("HRCommon")
USE J: "\\Admin\HR$"
ENDIF

IF INGROUP("PerformNow")
USE V: "\\Admin\SecureApps$"
ENDIF

IF INGROUP("Administration")
USE G: "\\Admin\DOAdmin$"
ENDIF


;------------------ EdServices Mappings ---------------------

IF INGROUP("IEPProviders")
USE I: "\\Admin\IEPProviders$"
ENDIF

IF INGROUP("EdServices")
USE Y: "\\Admin\EdServices$"
ENDIF

;IF INGROUP("IEPProviders") AND EXIST ("C:\AdobeYes.txt")=0
; RUN "\\tech\eXpress\rinstall\AdobeFull.exe -nr"
; COPY "\\tech\eXpress\rinstall\AdobeYes.txt" "C:\"
; ELSE
;ENDIF

;------------------ Cafe Mappings ---------------------

IF INGROUP("Cafeteria")
USE E: "\\admincafe\cafeterm"
USE X: "\\Admincafe\USDA"
USE Y: "\\admincafe\foodco6$"
ENDIF

;------------------ Transportation Mappings ---------------

IF INGROUP("Transportation")
USE T: "\\Admin\Trans$"
ENDIF

; ---------------- High School Drive Mappings ------------

IF INGROUP("UsersHS")
USE F: "\\SandDevil3\APPS"
USE U: "\\SandDevil\SearchPlus$"

Copy "F:\HSCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("SasiHS")
USE S: "\\SandDevil\SasiXP$"

Copy "F:\HSCDTwr\ATTEND~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("UsersHS") AND INGROUP("Teachers")
USE G: "\\SandDevil3\HSTeachers$"
ENDIF

IF INGROUP("UsersHS") AND INGROUP("Librarians")
USE T: "\\SandDevil\TextLink$"
ENDIF

;------------------Middle School Drive Mappings ---------------------

IF INGROUP("UsersMS")
USE F: "\\PANTHERS2\APPS"
USE U: "\\PANTHERS\SearchPlus$"

Copy "F:\MSCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("SasiMS")
USE S: "\\Panthers\SasiXP$"

Copy "F:\MSCDTwr\ATTEND~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("UsersMS")AND INGROUP("Teachers")
USE G: "\\panthers3\MSTeachers$"
ENDIF

IF INGROUP("UsersMS") AND INGROUP("Librarians")
USE T: "\\PANTHERS\TextLink$"
ENDIF

IF INGROUP("CCC")
USE M: "\\MSPAGE_CCC\CAI1"
USE N: "\\MSPAGE_CCC\CAI2"
USE O: "\\MSPAGE_CCC\CAI3"
USE S: "\\MSPAGE_CCC\History"
ENDIF

; ----------------Desert View Drive Mappings------------
IF INGROUP("UsersDV")
USE F: "\\BOBCATS3\APPS"
USE O: "\\bobcats\RnseServer$"
USE U: "\\bobcats\SearchPlus$"

Copy "F:\DVCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
Copy "F:\DVCDTwr\ARR6ST~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("SasiDV")
USE S: "\\Bobcats\SasiXP$"

Copy "F:\DVCDTwr\ATTEND~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("UsersDV") AND INGROUP("Teachers")
USE G: "\\bobcats3\DVTeachers$"
USE O: "\\bobcats\RnseServer$"

Copy "F:\DVCDTwr\ARR6TE~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

; ----------------Lake View Drive Mappings------------
IF INGROUP("UsersLV")
USE F: "\\EAGLES3\APPS"
USE U: "\\EAGLES\SearchPlus$"

USE I: "\\EAGLES\CDROM-1$"
USE J: "\\EAGLES\CDROM-2$"
USE K: "\\EAGLES\CDROM-3$"
USE L: "\\EAGLES\CDROM-4$"
USE M: "\\EAGLES\CDROM-5$"
USE N: "\\EAGLES\CDROM-6$"

Copy "F:\LVCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
Copy "F:\LVCDTwr\SEARCH~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("SasiLV")
USE S: "\\Eagles\SasiXP$"

Copy "F:\LVCDTwr\ATTEND~1.LNK" "C:\Documents and Settings\" + $username + "\Desktop"
ENDIF

IF INGROUP("UsersLV") AND INGROUP("Teachers")
USE G: "\\eagles3\LVTeachers$"
ENDIF

;------------------All Users Mappings -----------------
;IF INGROUP("DomainUsers")
;
; Copy "http://www.pageud.k12.az.us/HelpDesk/index.htm" "C:\Documents and Settings\" + $username + "\Desktop"
;
;ENDIF
;
:END
EXIT

Top
#165599 - 2006-08-09 09:48 AM Re: Error: error in USE Statement!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I still bet that this script is not the erroring one.
why? because the error is not just error but it is a crash.
and if script crashes, there has to be something fundamentally wrong, on the line given by kixtart.
and there is not in this one.

suzanne, for test purposes, download one of the kixtart 4.5x releases and run the script with it.
the error reporting has changed slightly from the days of kix 2001 and the error given might prove a bit more informative.

Top
#165600 - 2006-08-09 11:38 AM Re: Error: error in USE Statement!
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Les, you are right, $SiteServer has the hacks, except here, i think
Code:

IF INGROUP("UsersLV")
$SiteServer=Eagles3
$SiteExt="LV"
ENDIF


Maybe Eagles3 must have a preceeding $-sign to refer to the variable
Code:

$Eagles3="\\Eagles3\"


A statement like
Code:

Use H: "Eagles3Username$"


gives an error message like Suzanne gave.

Top
#165601 - 2006-08-09 02:33 PM Re: Error: error in USE Statement!
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Witto,
Good catch. Should be:

$SiteServer= $Eagles3

Top
#165602 - 2006-08-09 03:12 PM Re: Error: error in USE Statement!
Suzanne Offline
Lurker

Registered: 2006-08-08
Posts: 3
Sorry about that, it had been one of those days. My apologies
Top
#165603 - 2006-08-09 03:34 PM Re: Error: error in USE Statement!
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Belive me when I say this, but the gnu's around here crawes for troubleshooting, they are a bit too good at it, so problems don't drop in that often anymore (most true anyway =). Guessing that was the issue, glad to see it fixed.
Top
#165604 - 2006-08-09 03:40 PM Re: Error: error in USE Statement!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so, was it now that the error line suzanne gave us was wrong?

and why did kixtart 2001 crash on that?
the parameter type was correct, so it shouldn't had done that.

Top
#165605 - 2006-08-10 08:41 PM Re: Error: error in USE Statement!
Suzanne Offline
Lurker

Registered: 2006-08-08
Posts: 3
Just wanted to let everyone know that I made the changes:

IF INGROUP("UsersLV")
$SiteServer=Eagles3
$SiteExt="LV"
ENDIF


--------------------------------------------------------------------------------

Maybe Eagles3 must have a preceeding $-sign to refer to the variable
Code:
--------------------------------------------------------------------------------

$Eagles3="\\Eagles3\"


--------------------------------------------------------------------------------

A statement like
Code:
--------------------------------------------------------------------------------

Use H: "Eagles3Username

and then I also made this change... it looks like everything is now working.

$HomeDir = "\\" + $SiteServer + "\" + $UserName + $Extension

I appreaciate everyone's suggestions... Thanks a bunch, the help saved my hide since school is starting next Tuesday... Have a great day everyone!!

Top
#165606 - 2006-08-10 08:53 PM Re: Error: error in USE Statement!
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
That's strange, I would think you would only have to change
Code:

IF INGROUP("UsersLV")
$SiteServer=$Eagles3
$SiteExt="LV"
ENDIF


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 1574 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.157 seconds in which 0.09 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