#42730 - 2003-07-10 06:13 PM
Handling spaces in mapped drive paths
|
khaunani
Fresh Scripter
Registered: 2003-07-10
Posts: 12
Loc: Iowa, USA
|
I'm pretty new with this. I'm writing logon scripts and haven't figured out how to handle spaces in the pathname of a mapped drive. Here's an example:
$Drive = "O:" $Path = "\\server2\dp my files" USE $Drive /Delete USE $Drive $Path
Written as such, it will not map. Is there anything in the manual that explains how to handle this? A page number would be helpful. Otherwise, if anybody else has suggestions, I would appreciate the help.
Thanks, Khaunani
|
Top
|
|
|
|
#42731 - 2003-07-10 06:53 PM
Re: Handling spaces in mapped drive paths
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Khaunani,
Welcome to the board.
Is this in Windows 9x or NT?
What version of KiXtart are you using?
Thanks,
Kent
|
Top
|
|
|
|
#42732 - 2003-07-10 06:58 PM
Re: Handling spaces in mapped drive paths
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Add:
? "@error @serror"
after your USE statement. What is returned?
$Drive = "O:" $Path = "\\server2\dp my files" USE $Drive /Delete USE $Drive $Path ? "@error @serror"
|
Top
|
|
|
|
#42733 - 2003-07-10 07:04 PM
Re: Handling spaces in mapped drive paths
|
khaunani
Fresh Scripter
Registered: 2003-07-10
Posts: 12
Loc: Iowa, USA
|
Thanks for the welcome! Sorry I didn't give all the info. At least I can be guaranteed some type of post to my question.
Anyway, this is on a Windows 2000 server and the workstation are Windows 2000 as well.
Thanks, Khaunani
|
Top
|
|
|
|
#42734 - 2003-07-10 07:07 PM
Re: Handling spaces in mapped drive paths
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
What about Howard's suggestion? Any results from the @error and @serror codes?
What version of KiXtart are you using?
Kent [ 10. July 2003, 19:08: Message edited by: kdyer ]
|
Top
|
|
|
|
#42735 - 2003-07-10 07:08 PM
Re: Handling spaces in mapped drive paths
|
khaunani
Fresh Scripter
Registered: 2003-07-10
Posts: 12
Loc: Iowa, USA
|
I add the line ? @error @serror
when I ran the program, the message was:
67The Network name cannot be found.01
I am using the most recent version of Kixtart (sorry Kdyer)
Khaunani
|
Top
|
|
|
|
#42737 - 2003-07-10 08:34 PM
Re: Handling spaces in mapped drive paths
|
khaunani
Fresh Scripter
Registered: 2003-07-10
Posts: 12
Loc: Iowa, USA
|
When I hard code it as you suggested, I get the message:
67 The network name cannot be found. 01
Thanks, Khaunani
|
Top
|
|
|
|
#42738 - 2003-07-10 08:59 PM
Re: Handling spaces in mapped drive paths
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
what hapens when you:
net use O: \\server2\dp my files
in a DOS window?
Then net use O: "\\server2\dp my files"
Is this the only share that has a problem or do all share fail? [ 10. July 2003, 21:00: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#42740 - 2003-07-10 11:35 PM
Re: Handling spaces in mapped drive paths
|
kholm
Korg Regular
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
khaunani,
Try This:
code:
$Drive = "O:" $Path = '"\\server2\dp my files"' USE $Drive /Delete USE $Drive $Path
-Erik
ps. Only to Jooel,
What is: %20
New KiX macro
|
Top
|
|
|
|
#42742 - 2003-07-11 05:11 PM
Re: Handling spaces in mapped drive paths
|
khaunani
Fresh Scripter
Registered: 2003-07-10
Posts: 12
Loc: Iowa, USA
|
Okay, I'm really embarrassed to have to tell all of you this, but the problem was really simple. Thank you all for trying to help me out.
First of all, the code was fine:
$Drive = "O:" $Path = "\\server2\dp my files" USE $Drive /Delete USE $Drive $Path
The problem was that I didn't look at the share name before I started all of this. It is actually a hidden share so all I had to do was add $ to 'files'.
Again, I'm REALLY embarassed, but really impressed by how quickly all of you responded. I am posting another problem, so I hope I get the same positive responses.
Thanks, Khaunani
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
2 registered
(morganw, mole)
and 414 anonymous users online.
|
|
|