khaunani
(Fresh Scripter)
2003-07-10 06:13 PM
Handling spaces in mapped drive paths

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


Kdyer
(KiX Supporter)
2003-07-10 06:53 PM
Re: Handling spaces in mapped drive paths

Khaunani,

Welcome to the board.

Is this in Windows 9x or NT?

What version of KiXtart are you using?

Thanks,

Kent


Howard Bullock
(KiX Supporter)
2003-07-10 06:58 PM
Re: Handling spaces in mapped drive paths

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"


khaunani
(Fresh Scripter)
2003-07-10 07:04 PM
Re: Handling spaces in mapped drive paths

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


Kdyer
(KiX Supporter)
2003-07-10 07:07 PM
Re: Handling spaces in mapped drive paths

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 ]


khaunani
(Fresh Scripter)
2003-07-10 07:08 PM
Re: Handling spaces in mapped drive paths

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


Les
(KiX Master)
2003-07-10 07:16 PM
Re: Handling spaces in mapped drive paths

What happens if you hard code it?

use O: "\\server2\dp my files"
@error ?
@serror ?


khaunani
(Fresh Scripter)
2003-07-10 08:34 PM
Re: Handling spaces in mapped drive paths

When I hard code it as you suggested, I get the message:

67
The network name cannot be found.
01

Thanks,
Khaunani


Howard Bullock
(KiX Supporter)
2003-07-10 08:59 PM
Re: Handling spaces in mapped drive paths

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 ]


LonkeroAdministrator
(KiX Master Guru)
2003-07-10 10:13 PM
Re: Handling spaces in mapped drive paths

uhm.
I haven't even tried sharenames with spaces...

you could always try to use %20 in place of space but...

anyway, why you need the spaces there anyway?

others, are these types of shares working for you?
I cant currently test (purely unix env) but think this could be investigated.


kholm
(Korg Regular)
2003-07-10 11:35 PM
Re: Handling spaces in mapped drive paths

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 [Big Grin]


LonkeroAdministrator
(KiX Master Guru)
2003-07-10 11:40 PM
Re: Handling spaces in mapped drive paths

nah, no more cryptic than url-encoded space [Wink]

khaunani
(Fresh Scripter)
2003-07-11 05:11 PM
Re: Handling spaces in mapped drive paths

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


Sealeopard
(KiX Master)
2003-07-11 05:52 PM
Re: Handling spaces in mapped drive paths

Just make sure to read the KiXtart Manual and the FAQ Forum in addition to some script debugging before posting the next question [Smile]

[ 12. July 2003, 15:49: Message edited by: sealeopard ]