PDA

View Full Version : WSHNetwork.MapNetworkDrive (W98)



Picapica
06-01-2002, 02:59 PM
Hi,

I found this script on this site, and I use it to connect to the other pc on the LAN here:

Dim WSHNetwork
Set WSHNetwork = WScript.CreateObject("WScript.Network")
WSHNetwork.MapNetworkDrive "S:", "\\PCNAME\SharedDocs"

It works. Well it did anyway; if I execute the script now, the drive S appears in explorer, and I can access the SharedDocs. But after a minute or ten (it varies, I do not know why and still have not found a pattern) I want to get something from the other pc, click the 'S' drive in explorer and the msg:

S:\ is not accessible
The network path was not found.

appears. The connection just disappears; the S drive is still showing in explorer but can not be accessed.

No, the other pc did not shut down or reboot; it's always on. :D

Anyone got an idea?

-----------------------------------------------
desde hoy en adelante: la buena vida

ywhw
06-26-2002, 02:58 AM
I know this might be inapproriate for this forum, but why not just use

net use s: \\PCNAME\Share

if you have to have it in a script do this

wshshell.run "net use s: \\PCNAME\share",,True