Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Remove mapped drive through login script

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,64503
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Remove mapped drive through login script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Remove mapped drive through login script - 9/23/2008 5:05:56 PM   
  Frobs

 

Posts: 16
Score: 0
Joined: 9/22/2008
Status: offline
Hi

I am trying to create a login script in VBS instead of our current .BAT file and I am having some problems with removing the mapped drives.

The reason for removing the drives is that we have four departments located in four different locations, each department has it's own local server. Sometimes the users work in different departments so I have created the script so it checks for the logonserver and then the drives gets mapped according to the logonserver/department.

When I remove the drive mappings I use:
WSHNetwork.RemoveNetworkDrive "U:", force

When I map a drive I use:
WSHNetwork.MapNetworkDrive "U:", \\Servername\share

But it only results in a disconnected drive when I check in "My computer", can't I get it to remove the drive completely?

/Frobs

 
 
Post #: 1
 
 RE: Remove mapped drive through login script - 9/24/2008 12:14:19 AM   
  DiGiTAL.SkReAM


Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Try this:

WSHNetwork.RemoveNetworkDrive "U:", True, True



_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to Frobs)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Remove mapped drive through login script Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts