#36315 - 2003-02-11 09:21 PM
Windows NT network drive mapping
|
ktodi
Getting the hang of it
Registered: 2002-03-29
Posts: 60
|
I have a script written that uses the following lines:
SELECT ; CASE InGroup ("domain\Domain Admins") USE h: "\\server\user\@userid" IF @ERROR = 0 "The H: drive was successfully mapped to the folder " + @userid " on DTS02!" ELSE "The H: drive mapping to DTS02 failed! Code @error (@serror)" ENDIF ; ENDSELECT
Everything works fine on Win2K pro but when I log into a win nt4 workstation I get Code 53 (The network path cannot be found)
Any advice? Am I missing something? Manually from the run command I can connect to \\server\user\username.
|
|
Top
|
|
|
|
#36316 - 2003-02-11 09:23 PM
Re: Windows NT network drive mapping
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
check out the FAQ about mapping network drives.
basically NET USE is different between NT and 2k.
See the FAQ for details and workarounds.
|
|
Top
|
|
|
|
#36317 - 2003-02-11 09:30 PM
Re: Windows NT network drive mapping
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
hmmm... I can't find the FAQ...
Well, this is what you will want to do:
code:
select Case @producttype = "Windows XP Professional" $os="WinXP" $subcmd="net use" Case @producttype = "Windows 2000 Professional" $os="Win2K" $subcmd="net use" Case @producttype = "Windows NT Workstation" $os="WinNT" $subcmd="subst" endselect $DriveLetter='M' $UNC='\\server\share\folder' shell '%comspec% /c $subcmd $DriveLetter: "$UNC" 1>Nul 2>&1'
[ 11. February 2003, 21:31: Message edited by: Radimus ]
|
|
Top
|
|
|
|
#36318 - 2003-02-11 09:44 PM
Re: Windows NT network drive mapping
|
ktodi
Getting the hang of it
Registered: 2002-03-29
Posts: 60
|
I just looked through the 3 pages of FAQs and cannot find one relating to my problem. Can you either send me a link or tell me what the header is?
|
|
Top
|
|
|
|
#36319 - 2003-02-11 09:47 PM
Re: Windows NT network drive mapping
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
The basic problem is that NT4 does not support DEEP mapping.
My suggestion would be to create hidden shares for home directories and then map to \\server\share$.
The example above uses the SUBST command to achieve your result. [ 11. February 2003, 22:22: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#36320 - 2003-02-11 09:52 PM
Re: Windows NT network drive mapping
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
|
|
Top
|
|
|
|
#36321 - 2003-02-11 10:16 PM
Re: Windows NT network drive mapping
|
ktodi
Getting the hang of it
Registered: 2002-03-29
Posts: 60
|
This is my script now. Win2k works NT returns Code 1 (incorrect function)
; Setting enviroment variables ; select Case @producttype = "Windows XP Professional" $os="WinXP" $subcmd="net use" Case @producttype = "Windows 2000 Professional" $os="Win2K" $subcmd="net use" Case @producttype = "Windows NT Workstation" $os="WinNT" $subcmd="subst" endselect ; ; Home directory Mapping ; SELECT ; CASE InGroup ("MT_VIEW\Domain Admins") $DriveLetter='H' $UNC='\\dts02\user\@userid' shell '%comspec% /c $subcmd $DriveLetter: "$UNC" 1>Nul 2>&1' IF @ERROR = 0 "The H: drive was successfully mapped to the folder " + @userid " on DTS02!" ELSE "The H: drive mapping to DTS02 failed! Code @error (@serror)" ENDIF ; ENDSELECT
|
|
Top
|
|
|
|
#36322 - 2003-02-11 10:19 PM
Re: Windows NT network drive mapping
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
perhaps... shell '%comspec% /c net use $DriveLetter: /d' shell '%comspec% /c $subcmd $DriveLetter: /d'
make sure that on your test machine, you don't already have something mapped
|
|
Top
|
|
|
|
#36323 - 2003-02-11 10:24 PM
Re: Windows NT network drive mapping
|
ktodi
Getting the hang of it
Registered: 2002-03-29
Posts: 60
|
I don't understand how it will work now if it is missing the "$unc" variable. what is the 1>NUL 2>$1 for?
What is the subst command doing?
|
|
Top
|
|
|
|
#36324 - 2003-02-11 10:26 PM
Re: Windows NT network drive mapping
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
the active part in the above if the /d to remove any current mapping... can't map the letter if it is in use.
1>Nul 2>&1 is the magic redirection switches to suppress output from the command
|
|
Top
|
|
|
|
#36325 - 2003-02-11 10:28 PM
Re: Windows NT network drive mapping
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
code:
c:\data\scripts>subst /? Associates a path with a drive letter.
SUBST [drive1: [drive2:]path] SUBST drive1: /D
drive1: Specifies a virtual drive to which you want to assign a path. [drive2:]path Specifies a physical drive and path you want to assign to a virtual drive. /D Deletes a substituted (virtual) drive.
Type SUBST with no parameters to display a list of current virtual drives.
|
|
Top
|
|
|
|
#36326 - 2003-02-11 10:33 PM
Re: Windows NT network drive mapping
|
ktodi
Getting the hang of it
Registered: 2002-03-29
Posts: 60
|
Only C and D are being used on my test server. I have added one line:
Case @producttype = "Windows NT Server" $os="WinNT" $subcmd="subst"
and it still fails with the same error.
Am I supposed to be putting some variables after the "subst" command?
|
|
Top
|
|
|
|
#36327 - 2003-02-11 10:38 PM
Re: Windows NT network drive mapping
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
to make it easy... why don't you get the YAMD() udf, and let it do the work of mapping the drives
|
|
Top
|
|
|
|
#36328 - 2003-02-11 10:41 PM
Re: Windows NT network drive mapping
|
ktodi
Getting the hang of it
Registered: 2002-03-29
Posts: 60
|
I will do anything to make this easier. I looke at the KIxtart UDF library and do not see this UDF.
|
|
Top
|
|
|
|
#36329 - 2003-02-11 10:42 PM
Re: Windows NT network drive mapping
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
it is more than 10 days old.
|
|
Top
|
|
|
|
#36330 - 2003-02-11 10:43 PM
Re: Windows NT network drive mapping
|
ktodi
Getting the hang of it
Registered: 2002-03-29
Posts: 60
|
I will do anything to make this easier. I looked at the KIxtart UDF library and do not see this UDF.
|
|
Top
|
|
|
|
#36331 - 2003-02-12 12:00 AM
Re: Windows NT network drive mapping
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Im pretty sure even if you get the code correct that it will not work on NT 4.0 because of the inability to map deep mappings. Can only map to a share. So...
quote: USE h: "\\server\user\@userid"
Will only work if @userid is actually shared on the server.
EDIT - Nevermind...Just noticed that the UDF uses subst instead of net use. [ 12. February 2003, 00:03: Message edited by: CitrixMan ]
|
|
Top
|
|
|
|
#36332 - 2003-02-12 12:01 AM
Re: Windows NT network drive mapping
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
|
|
Top
|
|
|
|
#36334 - 2003-02-12 04:54 PM
Re: Windows NT network drive mapping
|
ktodi
Getting the hang of it
Registered: 2002-03-29
Posts: 60
|
I logged in with an NT4.0 workstation and the mapping works using the subst command. Thanks for all you help now I gotta get win9x working.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 675 anonymous users online.
|
|
|