Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to refresh networkdrive after mapping them?

Posted on 2004-09-30
5
Medium Priority
?
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 18

Expert Comment

by:armoghan
ID: 12198010
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
ID: 12199947
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
ID: 12602298
PAQed with points refunded (50)

modulo
Community Support Moderator
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

721 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