•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,448 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,660 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1132 | Replies: 3
![]() |
•
•
Join Date: Aug 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
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:
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.
I have already asked the admins to move this.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation:
Rep Power: 40
Solved Threads: 972
•
•
Join Date: Aug 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
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?
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?
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- 2003 Logon VBSript feedback (Windows NT / 2000 / XP / 2003)
- VBS script to map drives via AD 2003 (Visual Basic 4 / 5 / 6)
- Windows Script Host question (WSH logon script) (Windows NT / 2000 / XP / 2003)
- Help with vbs code for login script (VB.NET)
- Problems writing script which checks the users group and date (VB.NET)
- help with windows server logon script (Windows NT / 2000 / XP / 2003)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Text File manipulation/string extraction
- Next Thread: dictionary object



Linear Mode