Jump to content

How to Map a Network Drive with a Password


eds
 Share

Recommended Posts

Greetings All! :mellow:

I'm trying to write a script that will map a network drive (XP PC) that requires a user name and password. I also want it to save the username and password. I tried the DriveMapAdd function but it doesn't save the username and password on reboot.

So right now I'm running this command which works up to a point:

Run ("net use b: \\10.100.100.225\g /savecred /persistent:yes")

After several seconds of starting to run this, there is a command line prompt to enter the user, then after entering that, another prompt to enter the password.

How do I script for AuotIt to wait for these prompts and enter the specified data accordingly?

Thanks!

Link to comment
Share on other sites

Try this:

$usr = "administrator"
$pwd = "Test"
Run ("net use b: \\10.100.100.225\g /savecred /persistent:yes /user:" $usr & " " & $pwd)

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Unfortunately the above didn't work at all. Thanks for the suggestion. I found that Microsoft states that the net use command will not store a password permanently in the credentials manager. . It seems the only way a password is stored is when it is entered on the GUI interface

Edited by eds
Link to comment
Share on other sites

If you don't use the /savecred switch it should work!

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...