I have done a vb script to map the network drives. It works fine for me. But when I checked with a couple of other PCs, it doesn't work. Could anybody tell me why this is happening?

Here is the code:

Dim WSHNetwork
Set WSHNetwork = WScript.CreateObject("WScript.Network")

On Error Resume Next

WSHNetwork.RemoveNetworkDrive "Q:", True

WSHNetwork.RemoveNetworkdrive "P:", True	

WSHNetwork.MapNetworkDrive "Q:" , "\\ServerName\FolderName"

Set WSHNetwork = Nothing

WScript.Quit

This forum is meant for unix shell scripting. There is a forum for vb here, and this question should be asked there.

I have already asked the admins to move this.

Moved

The code which you are using seems to be correct. Can you please let me know the following details-
1) When you say "it does not work", what does that mean? Do you get any errors, if yes please post the error message.
2) Do you run this as a logon script? If yes, run the same script on command prompt and post the result.
3) Which version and build of WSH are you using?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.