PDA

View Full Version : map network drive in win95 (W95)



derricklyh
07-10-2003, 06:42 PM
I use the following code to map drive, it successes in
win2000 but not in win95. Would any one suggest
me some solutions?
----------------------------------------------
Const MAP_LOCALDRIVE = "M:"
Const MAP_REMOTEPATH = "\\server\folder"
Const MAP_USERNAME = "name"
Const MAP_PASSWORD = "pwd"

Dim objWshNetwork
Set objWshNetwork = CreateObject("WScript.Network")
objWshNetwork.MapNetworkDrive MAP_LOCALDRIVE, MAP_REMOTEPATH, false, MAP_USERNAME, MAP_PASSWORD
Set objWshNetwork = Nothing
----------------------------------------------
and the error message is "ActiveX cannot creat object WScript.network"

even the line "Set objWshNetwork = CreateObject("WScript.Network")"
changed to "Set objWshNetwork = WScript.CreateObject("WScript.Network")",
error still occurs, but another error message comes out
"cannot create object name WScript.network"