Discussion Locked

Logon Script - Delete Drive

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am looking for a logon script which will delete a network drive. Language = VBScript. I cannot get the DriveExist command to work. Do you have an example of a script that will make sure a drive letter is deleted before I create a new drive Mapping

5 replies

by pweegar1

If you want to develop your own script, add the net use command to the script. Using net use, you can delete existing drive mappings and/or when you establish a drive mapping, set it' persistance to no (from a command prompt type net use /? for help)

by guy

Thanks for your idea, but I am looking for a VBScript command e.g. DriveExist

by jackofalltech

Since I never use VBS, I don't know if this will work but, assuming you can DECLARE external routines in VBS, look up either WNetCancelConnection or WNetCancelConnection2 in the Win32 API reference.

Ralph

This discussion is closed to new replies.