User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Aug 2007
Posts: 6
Reputation: shers is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shers shers is offline Offline
Newbie Poster

MapNetworkDrive

  #1  
Nov 27th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2006
Posts: 1,509
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is offline Offline
Posting Virtuoso

Re: MapNetworkDrive

  #2  
Nov 27th, 2007
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.
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
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: MapNetworkDrive

  #3  
Nov 27th, 2007
Moved
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Aug 2007
Posts: 6
Reputation: sandeep_chalke is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sandeep_chalke sandeep_chalke is offline Offline
Newbie Poster

Re: MapNetworkDrive

  #4  
Nov 28th, 2007
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?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 1:55 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC