VB Script gurus - H...
 

Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop

[Closed] VB Script gurus - Help!

3 Posts
2 Users
0 Reactions
63 Views
Posts: 0
Free Member
Topic starter
 

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?


 
Posted : 21/10/2014 9:48 am
Posts: 0
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")


 
Posted : 21/10/2014 9:58 am
Posts: 0
Free Member
Topic starter
 

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.


 
Posted : 21/10/2014 10:44 am
Posts: 0
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.


 
Posted : 21/10/2014 11:06 am