Solved

How to refresh networkdrive after mapping them?

Posted on 2004-09-30
5
218 Views
Last Modified: 2010-05-18
Hello, everyone:
 
              Actually this is .vbs file, but I couldn't find right place for my question.
              I wrote one .vbs file, the purpose is that when you double click this .vbs file, it display login window for  user login, then mapping to some networkdrive, and also  generate msgbox or popup window after finish mapping, tell user which drive is mapped successfully.  
             My problem is in msgbox, it always tell you previous drive is mapped, rather than currently mapped. For example, drive G: K is alreday mapped, my program will disconnect them, mapping to M: N: S: X..... After run this vbs file, it maps to new drive, but the msgbox tell you drive G: K mapped successfully, rather than Drive M, N, S, X mapped.
             The following code is used after mappnetworkdrive:

                       Set AllDrives = objNetwork.EnumNetworkDrives()
                       For i = 0 To AllDrives.Count - 1 Step 2
                   TmpDrive = TmpDrive & AllDrives.Item(i)
                       Next
             objPopUp.popup "Drive " & tmpDrive & " connected successfully."

              Seems like need some "Refresh" function to refresh networkdrive. Does someone have suggestion about it or know right place to post my question, please let me know as soon as possible. Thanks a lot!
0
Comment
Question by:ltyao
5 Comments
 
LVL 18

Expert Comment

by:armoghan
Comment Utility
this link may help

http://www.codeproject.com/vbscript/userinfo.asp

you can post a link to VB section as well, they could help more
0
 

Author Comment

by:ltyao
Comment Utility
Thanks for your response. Actually, I fixed the bug yesterday by myself. The only thing you need to do is after disconnected drive, set AllDrive = Nothing, then after finish the mapping,  Set AllDrives = objNetwork.EnumNetworkDrives(), this way will solve my problem. Thank you so much!
0
 

Accepted Solution

by:
modulo earned 0 total points
Comment Utility
PAQed with points refunded (50)

modulo
Community Support Moderator
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now