Solved

How to refresh networkdrive after mapping them?

Posted on 2004-09-30
5
223 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

628 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