Results 1 to 9 of 9

Thread: VBA App to map a network drive

  1. #1
    Civil Engineering Moderator MHultgren's Avatar
    Join Date
    2000-12
    Location
    Central Iowa
    Posts
    1,441
    Login to Give a bone
    0

    Default VBA App to map a network drive

    Hello all,
    I am looking for a little stand alone app that I can stick on my desktop to open a dialog that will map a folder to a set drive letter. Cuurently, we have all of our projects located on a drive that is mapped to Q. Under that each of our projects are in folders that are named the same as the project number ( three digits a dash and two more digits). What I am looking for is to be able to click on an icon on the desktop that would open a dialog, type the project number into the list box and have the app map that folder to the top level of the P:\ drive. I have attached what I see the dialog looking like in case anyone is interested in playing with this.
    Attached Images Attached Images

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: VBA App to map a network drive

    Drive mappings can only be done to shares, and I doubt the IT manager wants to create a share for every job.

  3. #3
    Administrator richard.binning's Avatar
    Join Date
    2015-12
    Location
    In the foothills of the appalachians
    Posts
    2,261
    Login to Give a bone
    0

    Default Re: VBA App to map a network drive

    Don't forget about DOS...

    You can substitute the drive letter for the same results. I use the old dos subst command to emulate a network drive when disconnected from the network for this very effect.

    Code:
     subst f: C:\01_THC_MIRROR\f_Drive
    I had a VBS solution cooked up last year but when the hard drive crashed, I lost it.
    The above code works fine in a bat file.

    RLB

  4. #4
    Civil Engineering Moderator MHultgren's Avatar
    Join Date
    2000-12
    Location
    Central Iowa
    Posts
    1,441
    Login to Give a bone
    0

    Default Re: VBA App to map a network drive

    Thanks for the reply Robert. We have a share that is set up as the P drive already. We actually re-map each job to the P drive whenever we change from one job to another (That way our project data can be located in a sub folder under the project). But our users usually forget to do that and we end up with project data scattered across our server. I know, it's a training issue, but our Cad Manager doesn't think they need to be trained. (I think he is afraid of showing how much he doesn't know about the program). So I was looking for something that I could get everyone to use to make it easy. I have a lisp routine that will remap the P drive, but it doesn't work if you are already in a dwg in that folder. I have seen an app like that before and it was written in VBA, but I don't remember where I saw it.

  5. #5
    Civil Engineering Moderator MHultgren's Avatar
    Join Date
    2000-12
    Location
    Central Iowa
    Posts
    1,441
    Login to Give a bone
    0

    Default Re: VBA App to map a network drive

    I need something that cad monkeys can run without thinking about it. We have excellent Cad techs here, but they are less than decent when it comes to actually knowing how to use DOS. If it is something they can type in a box, they just might use it.

  6. #6
    Administrator richard.binning's Avatar
    Join Date
    2015-12
    Location
    In the foothills of the appalachians
    Posts
    2,261
    Login to Give a bone
    0

    Default Re: VBA App to map a network drive

    Do you need to disconnect the currently substituted drive before reassigning the drive letter to a new folder?

    P.S. I have the bat routine that I run by clicking a shortcut on the desktop.

    RLB

    Quote Originally Posted by MHultgren
    I need something that cad monkeys can run without thinking about it. We have excellent Cad techs here, but they are less than decent when it comes to actually knowing how to use DOS. If it is something they can type in a box, they just might use it.

  7. #7
    100 Club
    Join Date
    2000-11
    Location
    Adelaide, South Australia
    Posts
    116
    Login to Give a bone
    0

    Default Re: VBA App to map a network drive


  8. #8
    Civil Engineering Moderator MHultgren's Avatar
    Join Date
    2000-12
    Location
    Central Iowa
    Posts
    1,441
    Login to Give a bone
    0

    Default Re: VBA App to map a network drive

    Thanks Richard and ntaylor,

    I have to make this as easy as possible for the users. I just wanted a dialog that they can type in the job number and the share will be remapped to that folder. The job folder needs to be at the top level. Oh BTW, we use Novell here so that may have some impact on how it gets mapped also. I suppose I could use that BAT approach, but I would have to create one for each project ( a little more than 600, so that would not be very feasible).

  9. #9
    Administrator richard.binning's Avatar
    Join Date
    2015-12
    Location
    In the foothills of the appalachians
    Posts
    2,261
    Login to Give a bone
    0

    Default Re: VBA App to map a network drive

    You can do this using wmi, wsh, or vbs inside an hta file.

    I'll try to cook up an example for you later today.



    RLB

Similar Threads

  1. Network Drive Name Change
    By edinsmore595165 in forum CAD Management - General
    Replies: 10
    Last Post: 2013-08-28, 03:35 PM
  2. Unwanted ACA 09 Folders on Network Drive
    By LunaTick in forum ACA General
    Replies: 0
    Last Post: 2009-04-28, 10:20 PM
  3. How to Create a Simulated Network Drive?
    By Jack Cheong in forum Networks
    Replies: 4
    Last Post: 2008-05-09, 10:49 AM
  4. Working with Mapped Network Drive
    By ccowgill in forum AutoCAD General
    Replies: 2
    Last Post: 2007-08-08, 05:43 PM
  5. Network vs Hard Drive
    By ededios in forum AutoCAD General
    Replies: 2
    Last Post: 2007-07-19, 05:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •