Page 1 of 1 1
Topic Options
#23506 - 2002-06-19 04:12 PM mapping network drives
Donnam Offline
Fresh Scripter

Registered: 2002-06-19
Posts: 5
Am sorry for being a gumby but can't find much info on this...
All I want to do is something like this script, so I can map network drives for our clients...

IF InGroup( "Purchasing" )
net use P: \\server\public /y
net use i: "\\server\finance payments" /y

ENDIF

...but not sure if "net use" works etc as keeps erroring???
Please help
Donna :-)

Top
#23507 - 2002-06-19 04:15 PM Re: mapping network drives
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
donna, wellcome on board.
wow, really women on the mids of 5000 men!

kix mapping is done by just use.

so you script is just:
IF InGroup( "Purchasing" )
use P: \\server\public
use i: "\\server\finance payments"
ENDIF

{edit}
for quick syntax stuf, you can download:
http://kixtart.org/bin/KiXtart.chm - help-file-style file of the kix-document
or browse to kixtart HTML online manual

once again, you are more than wellcome and remember:
ask and you will be answered. not too silly question exists. only the ones never asked!

cheers,

[ 19 June 2002, 16:22: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#23508 - 2002-06-19 04:37 PM Re: mapping network drives
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
That manual is a great resource, ya know... if it were a guy needing help, I'd have been looking for a RTFM in the next post somewhere. [Big Grin]

Brian

Top
#23509 - 2002-06-19 04:39 PM Re: mapping network drives
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
welcome to the board...

Everyone, meet Donna. She just posted her first question... and it wasn't a poll [Smile]

If you have any questions, feel free to ask... odds are you will have an answer (or several) in only a few minutes.

As a bit of a tip, be sure to include the version of kix you are using and the OS of your clients.
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#23510 - 2002-06-19 04:46 PM Re: mapping network drives
Donnam Offline
Fresh Scripter

Registered: 2002-06-19
Posts: 5
Heh heh thanks guys, I appreciate the fast response :-) and yes, have loads of questions as am still getting errors and stuffed if I can find out how the error log works - am using NT4 server and NT4 workstations and nothing comming up in event viewer? I quickly see a syntax error or something like that in the script and am trying to get it to "sleep" so I can read it but not happening - have RTFM'd but patience wore out as am not a programmer sorry (just know the basics)...
Top
#23511 - 2002-06-19 04:52 PM Re: mapping network drives
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
donna, if you read my first reply, you see the answer to this particular error.

for future errors if it's syntax error, it causes kix to terminate and this means your sleep does not help.
on short scripts it's good to use debug (switch /d in calling line: "kix32 /d script.kix")

for extensive/large/complex scripts there is good kixstrip tool which checks syntax.
tool is downloadable from mca's site (link in kixtart.org-> scripts)

cheers,
_________________________
!

download KiXnet

Top
#23512 - 2002-06-19 04:53 PM Re: mapping network drives
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Donna,

Welcome to the board

For testing purposes you can set a get $ after each command , it will pause script execution until a key gets hit

hth

Jochen
_________________________



Top
#23513 - 2002-06-19 04:58 PM Re: mapping network drives
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jochen is speaking!
been pretty quiet for some time...

of course the get $ thingie works only when there is no syntax errors before it.

otherwise agree, I use it a lot.

cheers,
_________________________
!

download KiXnet

Top
#23514 - 2002-06-19 05:08 PM Re: mapping network drives
Donnam Offline
Fresh Scripter

Registered: 2002-06-19
Posts: 5
hmmm well nothing is working at all I'm sorry - it isn't a syntax error - it's a script error but still cannot capture it to give full description, as the /d doesn't work (just flashes command screen briefly and goes away) and get$ doesn't work as it is what Lonkero says...
I am using the "USE" command instead of "net use"???
I don't have any problems running the sample scripts, but can't find any "IF INGROUP" examples etc? Am startig to feel girly :-(

Top
#23515 - 2002-06-19 05:16 PM Re: mapping network drives
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Donna, it sounds like you are not executing your code in a DOS window. If you open a DOS window and execute your code "as kix32 scriptname.kix" then all the error text will remain on the screen for you to see.

If you post your code, we will take a look at it. Make sure you paste it between the code tags (clisk button "code" below edit window on the page).
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#23516 - 2002-06-19 05:35 PM Re: mapping network drives
Donnam Offline
Fresh Scripter

Registered: 2002-06-19
Posts: 5
Ok Howard, did what you said and it worked thanks :-) this is the error

code:
 Script error : error in USE statement !
ENDIF

Hope this helps?

Top
#23517 - 2002-06-19 05:36 PM Re: mapping network drives
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Post your script so we can take a peek.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#23518 - 2002-06-19 05:45 PM Re: mapping network drives
Donnam Offline
Fresh Scripter

Registered: 2002-06-19
Posts: 5
Ok guys, thanks for all your help - you were wonderful, but have worked it out at last! It was the /y at the end of the USE command - I was using it in my old NT4 login batch file etc...obviously doesn't register in Kixtart!
Cheers :-)
Donna

Top
#23519 - 2002-06-19 09:16 PM Re: mapping network drives
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
donna, didn't do my what the first post had to correct.
well, anyway good that you got it.

cheers,
_________________________
!

download KiXnet

Top
#23520 - 2002-06-20 04:41 AM Re: mapping network drives
Mastub8r Offline
Lurker

Registered: 2002-06-20
Posts: 1
New to the Forum but here is one that I wrote that seemed to work on NT4 server with 98/2k clients had to loop it several time to get it 2 work like I wanted. also pretty new to scripting so dont know if the codeing is correct or repitive

Break on

; Here we will define the variables used later
$Server1 = "\\PIPEMCPNT1\"
$Server2 = "\\PIPEMCPNT2\"
$Server3 = "\\PIPEMCP2K1\"
$Server4 = "\\PIPEMCP2K2\"
$Server5 = "\\PIPEMCP2K4\"

Select
Case InGroup("MOLDED\MAPPREQ") ;servername
If InGroup("MOLDED\MAPPREQ") ;Domain and Group
Use T: $server2 + "MAPPREQ" /persistent
;maps drive T to pipemcpnt2 share mappreq
Else
EndIf
EndSelect ;Then it repeats 2 check for the next group the user might be in

Select
Case InGroup("MOLDED\DOCUMENT")
If InGroup("MOLDED\DOCUMENT")
Use T: $server2 + "DOCDEPT" /persistent
Else
EndIf
EndSelect

Select
Case InGroup("MOLDED\MPQC")
If InGroup("MOLDED\MPQC")
Use T: $server2 + "DATA" /persistent
Else
EndIf
EndSelect

Select
Case InGroup("MOLDED\ENG")
If InGroup("MOLDED\ENG")
Use T: $server2 + "ENG" /persistent
Else
EndIf
EndSelect

Select
Case InGroup("MOLDED\NETADMIN")
If InGroup("MOLDED\NETADMIN")
Use M: $server2 + "ADMIN" /persistent
Use N: $server2 + "APPS" /persistent
Use U: $server2 + "MAPPREQ" /persistent
Use Y: $server2 + "SYS" /persistent
Else
EndIf
EndSelect
Sleep 1

Top
#23521 - 2002-06-20 04:54 AM Re: mapping network drives
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Welcome to the board.
Not sure why you have a SELECT CASE construct and then also nest an IF ELSE construct. They seem quite redundant.
Why bother with an ELSE if nothing follows?
Also, why use /Persistent switch if this script runs on every logon?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 1471 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.084 seconds in which 0.032 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