#75814 - 2003-07-11 08:51 PM
Newbie w/ problems
|
khaunani
Fresh Scripter
Registered: 2003-07-10
Posts: 12
Loc: Iowa, USA
|
Well, I'm wreaking havoc in the Starters forum, why not here?
I have batch file that checks for kix files on each PCs hard drive. Once they are copied, it will then call a kix program. In this program I am trying to delete existing drives and map the appropriate ones for that user.
I am using the Select...Case to do all of this, but for some reason, it is not going thru the list. Here is a sample of my script:
SELECT CASE @USERID = "CARRK" USE * /Delete USE F: "\\DSMNT2\RECMONTHLY" USE G: "\\DSMNT2\FMAGIC" USE S: "\\DSMNT4\PVSW$" USE T: "\\DSMNT4\DRIVE_S$" USE H: "\\DSMNT2\CARRK" USE I: "\\DSMNT2\NETLOGON\IT" USE J: "\\DSMNT2\RECORDERS" USE O: "\\DSMNT2\DP MY FILES$" USE F: "\\DSMNT2\RECMONTHLY" Sleep(3) Call "AddressWarning.txt" CASE @USERID = "CALVINM" USE * /Delete USE F: "\\DSMNT2\RECMONTHLY" USE G: "\\DSMNT2\FMAGIC USE H: "\\DSMNT2\CALVINM$" USE J: "\\DSMNT2\OPTISERV1" USE L: "\\DSMNT2\COPELANDC" USE M: "\\DSMNT2\MCVEYC" Sleep(3) Call "AddressWarning.txt" ENDSELECT
When I login (CARRK), as long as my CASE is first, it has no problem. But, if I put my CASE anywhere else, it does not do anything. If I check my mapped drives, they all have red X's on them.
The program "AddressWarning.txt" also has a CASE...SELECT, but it seems to have no problem sifting thru them. The only difference that I can see is that there aren't as many tasks connected to each one:
SELECT CASE @USERID = "CALVINM" $NAME = "MISHELLE HAMILTON" CASE @USERID = "ERICKSONG" $NAME = "GINA ERICKSON" CASE @USERID = "LEVINSONK" $NAME = "KAY LEVINSON" CASE @USERID = "CARRK" $NAME = "KIM CARR"
ENDSELECT I then use $NAME in a MessageBox string. Also, with the above program, I have 2 variables declared before doing the CASE. In the first program, the CASE/SELECT is the very first thing.
I'm using Windows2000 server and the PCs are Windows2000 as well. I am using the most recent version of Kixtart.
What am I missing? Thanks, Khaunani
|
|
Top
|
|
|
|
#75816 - 2003-07-11 10:39 PM
Re: Newbie w/ problems
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Why are you doing this?
$NAME = "MISHELLE HAMILTON"
You really should be using the macro @FULLNAME as you are with @USERID.. If you specify the name in script, this will become a headache as you will have to maintain it.
Kent
|
|
Top
|
|
|
|
#75818 - 2003-07-11 10:58 PM
Re: Newbie w/ problems
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
oh... and ignore the red x's they effectively mean nothing.
|
|
Top
|
|
|
|
#75819 - 2003-07-11 11:21 PM
Re: Newbie w/ problems
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
quote:
oh... and ignore the red x's they effectively mean nothing.
True - to a point. Windows 2000 and better tries to not establish a connection unless "called upon." When you ask for Drive L: for example, it then asks to get a connection and then removes the red "X".
HTH,
Kent
|
|
Top
|
|
|
|
#75821 - 2003-07-11 11:29 PM
Re: Newbie w/ problems
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Does the $ vs $$ matter here?
code:
USE T: "\\DSMNT4\DRIVE_S$$" USE O: "\\DSMNT2\DP MY FILES$"
Kent
|
|
Top
|
|
|
|
#75823 - 2003-07-14 05:23 PM
Re: Newbie w/ problems
|
khaunani
Fresh Scripter
Registered: 2003-07-10
Posts: 12
Loc: Iowa, USA
|
Thank you for all the suggestions. Now to just sift through them.
I will attempt the debugging. I haven't figured that out quite yet. Is there anyplace on the bulletin board that will step me through it? I don't know what to do once the debug menu comes up.
The $ signs in my mapped drives are for hidden shares. I haven't had any problems mapping to them the way I have them written.
Thanks, Khaunani
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|