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
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