Viewing 4 posts - 1 through 4 (of 4 total)
  • VB Script gurus – Help!
  • chojin
    Free Member

    I need to create a script which prompts the user for a subfolder name, and then subsequently uses this subfolder name variable to map a network drive.
    The first part of the UNC path will never change, but the subfolder name could be anything.

    My aim here is to help shield users from seeing parts of the folder structure they shouldn’t do (aided by AD permissions).

    Hope that makes sense?

    mossimus
    Free Member

    Why not make the other shares hidden if you do not want users to see them or control visibility with permissions?

    In answer to your Q, something along the lines of.

    MyVariable = InputBox(“Enter folder name”)

    chojin
    Free Member

    The shares are constantly changing (archived, restored), to add to the complexity, the users will change daily.

    My VB scripting is lacking somewhat so a working script (I can change the variables) would be reeeaally helpful.

    mossimus
    Free Member

    Something along these lines. (Mapped to drive X)

    Dim objNetwork, strLocalDrive, strRemoteShare, strConstantPath, strFolder
    Set objNetwork = WScript.CreateObject(“WScript.Network”)
    strLocalDrive = “X”
    strConstantPath = “\\myserver\”
    strFolder = InputBox(“Enter folder name”)
    strRemoteShare = strConstantPath & strFolder
    objNetwork.MapNetworkDrive strLocalDrive, strRemoteShare

    The MapNetworkDrive method will also accept credentials if need be.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘VB Script gurus – Help!’ is closed to new replies.