Page 1 of 1 1
Topic Options
#42730 - 2003-07-10 06:13 PM Handling spaces in mapped drive paths
khaunani Offline
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 Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#42732 - 2003-07-10 06:58 PM Re: Handling spaces in mapped drive paths
Howard Bullock Offline
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"
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#42733 - 2003-07-10 07:04 PM Re: Handling spaces in mapped drive paths
khaunani Offline
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 Offline
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 ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#42735 - 2003-07-10 07:08 PM Re: Handling spaces in mapped drive paths
khaunani Offline
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
#42736 - 2003-07-10 07:16 PM Re: Handling spaces in mapped drive paths
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What happens if you hard code it?

use O: "\\server2\dp my files"
@error ?
@serror ?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#42737 - 2003-07-10 08:34 PM Re: Handling spaces in mapped drive paths
khaunani Offline
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 Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#42739 - 2003-07-10 10:13 PM Re: Handling spaces in mapped drive paths
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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.
_________________________
!

download KiXnet

Top
#42740 - 2003-07-10 11:35 PM Re: Handling spaces in mapped drive paths
kholm Offline
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 [Big Grin]

Top
#42741 - 2003-07-10 11:40 PM Re: Handling spaces in mapped drive paths
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
nah, no more cryptic than url-encoded space [Wink]
_________________________
!

download KiXnet

Top
#42742 - 2003-07-11 05:11 PM Re: Handling spaces in mapped drive paths
khaunani Offline
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
#42743 - 2003-07-11 05:52 PM Re: Handling spaces in mapped drive paths
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
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 ]
_________________________
There are two types of vessels, submarines and targets.

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
2 registered (morganw, mole) and 414 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

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