Solved

How to refresh networkdrive after mapping them?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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 …
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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