Page 1 of 1 1
Topic Options
#19348 - 2002-04-02 06:11 PM Problem with re-mapping drive letters?
CWaters Offline
Lurker

Registered: 2002-04-02
Posts: 2
What am I missing? I've written a simple Kixtart script that maps a users' drive letter to a server share:

USE S: "\\SERVER1\Accounting"

This works fine unless the drive is *already* mapped to another server share--in which case, the original drive mapping is retained.

As this particular company's environment is constantly changing, the scripts need to be flexible enough to map drive letters that are already mapped. I was hoping that Kixtart could handle re-mapping drive letters, as needed.

I preceded the above line with:

USE S: /DELETE

and:

USE * /DELETE

even:

USE "*" /DELETE

since the Kixtart documentation lists the 'format' without an asterisk, but the 'example' with the asterisk.

The results are the same--the S: drive continues to point to the original share. It's almost like the workstations are ignoring the command. BTW, this is with Kixtart 4.02, with Windows 2000 Professional computers.

Are there any documented problems with Kixtart re-mapping drive letters?

Top
#19349 - 2002-04-02 06:13 PM Re: Problem with re-mapping drive letters?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You need to remove the current mapping. And you should be checking the result. try adding the "/Persistent" switch to your "USE /Delete".

code:
 Function MapDrive($Drive, $Server, $Share)
Dim $Drive, $Server, $Share
Color c+/n
If $Drive<>"" and $Server<>"" and $Share<>""
$LogText="Connecting $Drive to \\$Server\$Share"
? $LogText
USE $Drive /Delete /Persistent
USE $Drive "\\$Server\$Share"
If @error=0
color g+/n
$x=" - Success"
"$x"
Else
color r+/n
$x=" - Failed: Error @error"
"$x"
$ErrorState=1
Endif
WriteLog ($LogText + $x)
Color w+/n
Else
WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'")
Endif
Endfunction



[ 02 April 2002, 18:19: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#19350 - 2002-04-02 06:29 PM Re: Problem with re-mapping drive letters?
CWaters Offline
Lurker

Registered: 2002-04-02
Posts: 2
Thanks! I thought I *was* removing the current mapping. Curious, why is /PERSISTENT needed for a map *removal*? What does Kixtart consider the alternative to be? I don't see any explanation as to what /PERSISTENT does in the Kixtart docs.

Concerning drive *mapping*, I hadn't been using /PERSISTENT...and it's been working fine. What is the value of adding this parameter to drive mappings?

Top
#19351 - 2002-04-02 06:38 PM Re: Problem with re-mapping drive letters?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Maybe it adds nothing to your case. The more important aspect here is that you are not checking the @error to determine why your delete is not working and why the map actually fails. If you provide this info the situation may become clearer.

[ 02 April 2002, 18:38: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

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

Generated in 0.062 seconds in which 0.035 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