Ariella
(Lurker)
2002-06-19 06:55 PM
Not mapping network drives

Hi everyone,

I've been using correct syntax for my script and it is running correctly, however the script is not mapping network drives. I'll post a copy of the script to see whether there's something wrong with it, but I don't think there is.

If I run from a cmd line, I can access each of these network drives through their path, so they are definitely pointing at the right place.
code:
use u: "\\hb2\STMusers\@userid$"
use i: "\\hb2\apps"

IF INGROUP("HEALTHLABEL")
use j: "\\hb2\stm\hlabel"
ENDIF

IF INGROUP("TM1")
use r: "\\hb2\P&T\data\F&A\FS\F&A\TM1DATA"
ENDIF

IF INGROUP("SMD")
use s: "\\hb2\stm\smd"
ENDIF

IF INGROUP("CDTEST")
use g: "\\hb2\stm\scitech"
use q: "\\hb2\stm\netbip"
ENDIF

Thanks!

Ariella.

[ 19 June 2002, 18:58: Message edited by: Howard Bullock ]


Howard Bullock
(KiX Supporter)
2002-06-19 07:04 PM
Re: Not mapping network drives

What OS is your client? Only W2K and XP can do deep mapping.

Add error checking to your script.
code:
use u: "\\hb2\STMusers\@userid$"
? "\\hb2\STMusers\@userid$ @error @Serror"
use i: "\\hb2\apps"
? "\\hb2\apps @error @Serror"

IF INGROUP("HEALTHLABEL")
use j: "\\hb2\stm\hlabel"
? "\\hb2\apps @error @Serror"
ENDIF

IF INGROUP("TM1")
use r: "\\hb2\P&T\data\F&A\FS\F&A\TM1DATA"
"\\hb2\P&T\data\F&A\FS\F&A\TM1DATA @error @Serror"
ENDIF

IF INGROUP("SMD")
use s: "\\hb2\stm\smd"
"\\hb2\stm\smd @error @Serror"
ENDIF

IF INGROUP("CDTEST")
use g: "\\hb2\stm\scitech"
"\\hb2\stm\scitech @error @Serror"
use q: "\\hb2\stm\netbip"
ENDIF

What is the result?


Ariella
(Lurker)
2002-06-19 08:56 PM
Re: Not mapping network drives

I tried adding the errors and found the problem. I'm using Win2k, so no problem there.

Thanks a lot. [Smile]

Ariella.


MCA
(KiX Supporter)
2002-06-20 12:54 AM
Re: Not mapping network drives

Dear,

A wlecome to thoe the board.

Can you return your solution for the other readers of this board.
Thanks, greetings.


Dunc
(Getting the hang of it)
2002-06-20 08:44 PM
Re: Not mapping network drives

Hello,

I also seem to be having trouble with mapping drives. Please, It may be me do things wrong!

I am trying to map a drive, but getting the path to map to from a variable. Can this be done?

Here is a short script that indicates just what I am trying to do.

$Share = "Common"
$Path = "maff.gov.uk"
$server = "ITD001df"

USE T: \\ITD001df.maff.gov.uk\common ; This Works OK

USE y: \\$server.$path\$share ; This does not !

Thanks Duncan


Darren_W
(Hey THIS is FUN)
2002-06-20 09:26 PM
Re: Not mapping network drives

Hi,

Try this:

$mappath="\\"+$server+"."+$path+"\"+$share

USE y: $mappath

Darren

[ 20 June 2002, 21:32: Message edited by: Darren ]


Dunc
(Getting the hang of it)
2002-06-21 10:35 AM
Re: Not mapping network drives

Thanks Darren,

That worked great, I had tried something like that, I must have missed something!!!

Thanks again.

Duncan


BrianTX
(Korg Regular)
2002-06-21 05:17 PM
Re: Not mapping network drives

You're only problem, Duncan, was that you didn't use quotes:

Your code:
USE y: \\$server.$path\$share

should work if it is:

USE Y: "\\$server.$path\$share"

Of course:

USE Y: "\\"+$server+"."+$path+"\"+$share

also works (as Darren pointed out).

The interesting thing about KiXtart is it allows you to insert single-dimensional objects into your string declarations via label.

$a = "hi"
$b = "$a how are you?"
($b comes out as "hi how are you")

However, you cannot use arrays like that:
$a[0]="hi"
$b = "$a[0] how are you?"
does not work.

COM object methods do not execute inside quotes, either.

Brian


Johnh
(Fresh Scripter)
2002-06-21 06:54 PM
Re: Not mapping network drives

I'm confused (and maybe disoriented too). The first drive mapping does NOT work. The rest work great. What am I missing? The first map is to an NT server, the rest to Win2k servers. I can accomplish same at cmd line via net use... ...any ideas?

;-----------------------------------------------
;GENERAL Drive Mappings
;-----------------------------------------------
USE M: /DELETE
USE M: "\\ntserver\HTFORGE" /PERSISTENT:YES
? "\\ntserver\HTFORGE @error @Serror"

USE P: /DELETE
USE P: "\\TMMSERVER\PROGRESS" /PERSISTENT:YES
? "\\TMMSERVER\PROGRESS @error @Serror"

USE S: /DELETE
USE S: "\\ZEUS\DTR" /PERSISTENT:YES
? "\\ZEUS\DTR @error @Serror"

USE T: /DELETE
USE T: "\\TMMSERVER\TMM" /PERSISTENT:YES
? "\\TMMSERVER\TMM @error @Serror"


Howard Bullock
(KiX Supporter)
2002-06-21 07:02 PM
Re: Not mapping network drives

You didn't tell what @error and @serror returned. That information would be helpful when trying to determine the problem with the "M:" drive use statement.

[ 21 June 2002, 19:03: Message edited by: Howard Bullock ]


Johnh
(Fresh Scripter)
2002-06-21 07:09 PM
Re: Not mapping network drives

Sorry Howard,

The M: drive mapping will not return a message at all, the rest yield a success message.

Thanks for brainstorming with me (all I was coming up with was a light drizzle).


Howard Bullock
(KiX Supporter)
2002-06-21 07:21 PM
Re: Not mapping network drives

Please include more of your code. If the simple line
code:
? "\\ntserver\HTFORGE @error @Serror"

doesn't print something larger than the USE statement is wrong.

Why are you using the Persistent switch?

[ 21 June 2002, 19:22: Message edited by: Howard Bullock ]


Johnh
(Fresh Scripter)
2002-06-21 07:30 PM
Re: Not mapping network drives

I copied most of this stuff from a run-once script - the persistent switch doesn't make sense now (duh). I tried this with same results. Everything else works GREAT !

SETTITLE("HTI Login Script")

;-----------------------------------------------
;GENERAL Drive Mappings
;-----------------------------------------------
USE M: /DELETE
USE M: "\\ntserver\HTFORGE"
? "\\ntserver\HTFORGE @error @Serror"

USE P: /DELETE
USE P: "\\TMMSERVER\PROGRESS"
? "\\TMMSERVER\PROGRESS @error @Serror"

USE S: /DELETE
USE S: "\\ZEUS\DTR"
? "\\ZEUS\DTR @error @Serror"

USE T: /DELETE
USE T: "\\TMMSERVER\TMM"
? "\\TMMSERVER\TMM @error @Serror"

USE Z: /DELETE
USE Z: "\\ZEUS\PUBLIC"
? "\\ZEUS\PUBLIC @error @Serror"

;-----------------------------------------------
;GROUP Drive Mapping
;-----------------------------------------------
IF INGROUP("Domain Admins")
USE X: /DELETE
USE X: "\\ZEUS\IT$"
? "\\ZEUS\IT$ @error @Serror"
GOTO END
ENDIF


Howard Bullock
(KiX Supporter)
2002-06-21 07:37 PM
Re: Not mapping network drives

Execute just this. What happens.
code:
? "Delete Existing Drive M:"
USE M: /DELETE /PERSISTENT
? "Delete M: @error @serror"
? "Map M:"
USE M: "\\ntserver\HTFORGE"
? "\\ntserver\HTFORGE @error @Serror"



Johnh
(Fresh Scripter)
2002-06-21 07:51 PM
Re: Not mapping network drives

It works great!
What happened? (sorry I'm a little slow)
Is it the /persistent switch on the use m: /delete command??
Please help me understand.
You've been a great help already

jh


Howard Bullock
(KiX Supporter)
2002-06-21 08:07 PM
Re: Not mapping network drives

Does your original script now work?

I always use the PERSISTENT switch when performing a delete because I have seen where if a drive was mapped with the Persistent switch either via script or manually the DELETE failed. I do not yet understand why your text line did not print. Maybe the USE /delete failure somehow screwed up the new to lines?


kholm
(Korg Regular)
2002-06-21 08:19 PM
Re: Not mapping network drives

Don't add :Yes to /Persisten in KiX

From batch or prompt:
Net use M: /Delete /Persisten:Yes

From KiX:
Use M: /Delete /Persistent


Johnh
(Fresh Scripter)
2002-06-21 08:34 PM
Re: Not mapping network drives

Got it. It works fine now.
Thanks for sharing your brains !!! I really appreciate it!!


Howard Bullock
(KiX Supporter)
2002-06-21 08:48 PM
Re: Not mapping network drives

Check out http://81.17.37.55/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=004400&p= for my drive mapping and quick logging functions. They may simplify your life.

Dunc
(Getting the hang of it)
2002-06-24 06:56 PM
Re: Not mapping network drives

Hi,

Can someone answer this?

Is there any reason that I can get Kix to map a drive using FQDN under Windows 2000/NT/XP, but cannot for Windows 98.

I am trying to rewrite a logon script that works for all three OS.

USE T: "\\ITD001df.maff.gov.uk\common"

Thanks

Duncan


BrianTX
(Korg Regular)
2002-06-24 07:09 PM
Re: Not mapping network drives

Windows 9x doesn't support mappings that way. It can only use NETBIOS names.

Brian


Les
(KiX Master)
2002-06-24 08:04 PM
Re: Not mapping network drives

Do you have the AD client installed? If not, I wonder if it would make the difference.

Dunc
(Getting the hang of it)
2002-06-25 11:51 AM
Re: Not mapping network drives

LLigetfa,

No we don't have the AD client loaded. We are still using an NT4 domain, but I may try loading it, ready for AD which will take years at the rate we're going!!!!

Brian,

That was the conclusion that I had come to, however if you use the net use command, it works fine. (I was trying not to shell out of kix!)

Thanks for the help

Duncan