Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing Blank Net Drives

Status
Not open for further replies.

WalleyeGuy

Technical User
Oct 18, 2007
44
US
Hiya All,

I have a logon script that works great on all 'Workstations'. My problem is that now the company I'm at is rolling out Terminal Servers so my logon script needs a tweak and I cannot figure out what (should say how).

For some reason, the company I'm at, wants all network drives unmapped prior to mapping (hmmpf). Anyway, I can get that to work on all workstations, but with the term server they get those 'blank' drives.

Anyway, code is:

Set colDrives = wshNetwork.EnumNetworkDrives
For i = 0 To colDrives.Count -1 Step 2
wshNetwork.RemoveNetworkDrive colDrives.Item(i),_
Force, UpdateProfile
WScript.sleep 100
Next



Not sure how to remove the 'blank mappings' such as...
Drive = \\TSCLIENT\F Where there is no drive letter.

I saw a post that mentioned how to do it, and I cannot find it again here.

Thanks All
 
The drives you are referring to are the local drive redirection from the TS client.

There is no need to unmap them, just prevent them from being created in the first place.

Start, Programs, Administrative Tools, Terminal Services Configuration.

Click Configuration
In the right pane, Right Click RDP-TCP, Choose Properties.
Click the Client Settings tab.
Put a check in the box next to Drive Mapping under the heading of Disable the following:.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Yup, those are the drives I'm talking about.
However, I need to unmap them, as I also need to keep the drive redirection.

However, I simply added the 'On Error Resume...'.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top