Jump to content
Sign in to follow this  

Removing Credentials

Recommended Posts

I'm currently using DriveMapAdd and DriveMapDel to map and unmap drives. Unfortunately, this doesn't remove credentials.

Therefore, I wrote in the following to make sure that the credentials are removed after a drive is unmapped:

Run(@ComSpec & " /c " & 'net use * /delete /yes', "", @SW_HIDE)

I also set the following at the beginning of the script:

Run(@ComSpec & " /c " & 'net use /persistent:no', "", @SW_HIDE)

Unfortunately, there's about a 15 second delay between the disconnecting and net use command and the credentials actually getting deleted. Therefore, if a user were to run the script and therefore unmapping the drive, they still have about 15 seconds in which they can access files on the mapped drives. If they do so during this time, it "sticks" and they keep the ability to access the mapped drive.

Is there anything in the DriveMapAdd function that will specify a "don't save credentials" sort of option? Is there another way of handling this? This is mission critical.

Thank you!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...