Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to refresh networkdrive after mapping them?

Posted on 2004-09-30
5
Medium Priority
?
228 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
3 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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 …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

783 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