Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapping network drive in Windows 98 with spaces in folder name

Status
Not open for further replies.

jstringer

Programmer
Nov 2, 2002
11
CN
Hi,

I'm trying to setup a simple script to map a network drive in windows 98. The script runs fine on Windows XP or Windows 2K, but I can't seem to get the script to work when mapping in Windows 98. I have a feeling it's because the network folder that I am trying to map to has spaces in it (e.g. "Joe Smith"). Below is the script that I'm using, any suggestions on how I might get it to work with Win98?

Dim WSHShell, WSHNetwork, UserString
Set WSHNetwork = CreateObject("WScript.Network")
UserString = WSHNetwork.UserName

WSHNetwork.MapNetworkDrive "H:", "\\Network\University Student\" & UserString, True
'End Script

As I said above, this works fine in windowsXP or 2K, but won't work in Win98. I believe it's because of the space in "University Student", but I don't know of any way to get around this. Any suggestions would be a great help! Thanks.

Oh and it also doesn't work if I try to map a network drive the old fashioned way, for example "\\Network\University Student\Joe.Smith". The drive will only map to "\\Network" and leave the rest out.

Cheers,

John
 
Have you tried this ?
WSHNetwork.MapNetworkDrive "H:", Chr(34) & "\\Network\University Student\" & UserString & Chr(34), True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
1. In W98 you may not map drive into \\server\share\folder, only into \\server\share.
2. Try use from command line on W98:
net use H: "\\Network\University Student\"
I think it will not work too, hence script is not wrong, but share name - yes.

WBR, Vadim V. Petukhov,
MCSA on W2K
 
No, it doesn't work when I do a map the normal way in Win98. I think that's the problem. Is there any way to get around it? That is, map a network drive to a subfolder in windows 98?

Thanks again,

John

Oh and I tried Chr (34), it didn't work either.
 
what if you made that subfolder a share? You should be able to map to it then.
 
Yes, I believe that would work, but I'm afraid I do not have the necessary rights to do this on the network. I think this might be a lost cause :-( .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top