Page 1 of 1 1
Topic Options
#141380 - 2005-06-09 02:58 PM more drive mapping help - different script this time
astout Offline
Fresh Scripter

Registered: 2005-06-07
Posts: 16
Am I using the correct syntax here? I do a debug on this and I don't get any errors, but then again, I don't get any drive mappings either....

If InGroup("EVERYONE")
Shell "NET USE S: \\KC-dc01\SWAPS$"
Shell "NET USE G: \\FS1\ENG\SCANS$"
EndIf
If InGroup ("Administrators")
Shell "Net use y: \\fs1\it department$"
EndIf

If InGroup ("EngScan")
Shell "net use g: \\fs1\eng\scans$"
EndIf

If InGroup ("FnForCst")
Shell "Net use p: \\kc-exc1\shared\fnforcast$"
EndIf
If InGroup ("K-pac")
Shell " net use p: \\kc-exec1\shared\k-pac$" 'same on this one
EndIf
If InGroup ("S&OP")
Shell "net use q: \\kc-exec1\shared\s&op$" 'this one may give you fits cuz of the & sign
EndIf
If InGroup ("WKLYORD")
Shell "net use r: \\kc-exec1\shared\wkly orders$"
EndIf
If InGroup ("Senior Staff")
Shell "net use U: \\kc-exc1\shared\seniorstaff$"

EndIf

Top
#141381 - 2005-06-09 02:59 PM Re: more drive mapping help - different script this time
astout Offline
Fresh Scripter

Registered: 2005-06-07
Posts: 16
and yes, i know EVERYONE and EngScan get the same mapping..... but regardless, it should still map SOMETHING!??
Top
#141382 - 2005-06-09 03:10 PM Re: more drive mapping help - different script this time
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Debugging is more than just turning it on. While you single step throught the script, you need to watch the flow and query some vars to see what is happening.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#141383 - 2005-06-09 03:11 PM Re: more drive mapping help - different script this time
astout Offline
Fresh Scripter

Registered: 2005-06-07
Posts: 16
so what is wrong with my syntax? Is it the "shell" statement? Honestly I don't even know how to query any vars - I'm a BIG time scripting n00b!
Top
#141384 - 2005-06-09 04:02 PM Re: more drive mapping help - different script this time
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well... first off, if you watched the screen closely to see what command is being executed at a particular line, you might notice that you are using single quotes where semicolons should be used for commenting. This is not VBS.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#141385 - 2005-06-09 06:46 PM Re: more drive mapping help - different script this time
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, lets start with changing your code to kixtart.
there is no use using it if you keep shelling out each line.
Code:

If InGroup("EVERYONE")
Shell "NET USE S: \\KC-dc01\SWAPS$"
Shell "NET USE G: \\FS1\ENG\SCANS$"
EndIf



should be like:
Code:

If InGroup("EVERYONE")
USE S: "\\KC-dc01\SWAPS$"
USE G: "\\FS1\ENG\SCANS$"
EndIf



then, specially as you don't know what is going on, error checking must be applied!!!!
Code:

If InGroup("EVERYONE")
USE S: "\\KC-dc01\SWAPS$"
if @error
? "Couldn't map drive S:"
? "ERROR: " @error " " @serror
sleep 5
endif
USE G: "\\FS1\ENG\SCANS$"
if @error
? "Couldn't map drive S:"
? "ERROR: " @error " " @serror
sleep 5
endif
EndIf

_________________________
!

download KiXnet

Top
#141386 - 2005-06-09 07:08 PM Re: more drive mapping help - different script this time
astout Offline
Fresh Scripter

Registered: 2005-06-07
Posts: 16
thank you SOOOOOOOOO much -- I'm going to try it now.
Top
#141387 - 2005-06-09 10:50 PM Re: more drive mapping help - different script this time
astout Offline
Fresh Scripter

Registered: 2005-06-07
Posts: 16
Doesn't map anything!?!?!?
Top
#141388 - 2005-06-09 10:56 PM Re: more drive mapping help - different script this time
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
what did the error codes say?
Top
#141389 - 2005-06-09 11:43 PM Re: more drive mapping help - different script this time
astout Offline
Fresh Scripter

Registered: 2005-06-07
Posts: 16
that's the thing - i'm not getting any error codes - the GUI pops up - goes through all the checkboxes - then installs VNC and exits
but no drives mapped

i just need a simple simple simple If member of then script - apparently this big graphical one is too much for me....

Top
#141390 - 2005-06-10 01:04 AM Re: more drive mapping help - different script this time
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
That's what you've been provided!

Also, it seems you haven't provided the complete script, thus problems in other sections can cause this particular section to fail.

You might also want to look into the use of any of the MapDrive() UDFs.

Finally, execute the code below from the command-lien using KIX32.EXE adn report back:
Code:

$iRC=setoption('Explicit','on')
$iRC=setoption('NoVarsInStrings','on')

If InGroup("EVERYONE")
USE S: "\\KC-dc01\SWAPS$"
if @error
? "Couldn't map drive S:"
? "ERROR: " @error " " @serror
sleep 5
endif
USE G: "\\FS1\ENG\SCANS$"
if @error
? "Couldn't map drive S:"
? "ERROR: " @error " " @serror
sleep 5
endif
EndIf

_________________________
There are two types of vessels, submarines and targets.

Top
#141391 - 2005-06-10 01:06 AM Re: more drive mapping help - different script this time
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
If this is not resolved (should be, but one never knows) If InGroup("EVERYONE")

Then he would get nothing on the console either.

Need to have an ELSE in there to show incase the InGroup does not return data.
 

Top
#141392 - 2005-06-10 01:09 AM Re: more drive mapping help - different script this time
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
now, there will be a simple console window with error codes, or drives mapped.
or you have set console to hidden.
but it surely will give you something.
_________________________
!

download KiXnet

Top
#141393 - 2005-06-10 01:15 AM Re: more drive mapping help - different script this time
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Improved:
Code:

$iRC=setoption('Explicit','on')
$iRC=setoption('NoVarsInStrings','on')

If InGroup("EVERYONE")
USE S: "\\KC-dc01\SWAPS$"
if @error
? "Couldn't map drive S:"
? "ERROR: " @error " " @serror
sleep 5
endif
USE G: "\\FS1\ENG\SCANS$"
if @error
? "Couldn't map drive S:"
? "ERROR: " @error " " @serror
sleep 5
endif
ELSE
? "You are not in group EVERYONE"
sleep 5
EndIf


_________________________
There are two types of vessels, submarines and targets.

Top
#141394 - 2005-06-10 01:28 AM Re: more drive mapping help - different script this time
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
right!
good one jens.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.061 seconds in which 0.028 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