eds Posted September 1, 2011 Share Posted September 1, 2011 Greetings All! 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 More sharing options...
pieeater Posted September 1, 2011 Share Posted September 1, 2011 Maby WinWaitActive() is what your looking for? [spoiler]My UDFs: Login UDF[/spoiler] Link to comment Share on other sites More sharing options...
Juvigy Posted September 2, 2011 Share Posted September 2, 2011 The net use command supports username and password. Open CMD and type Net Use /? or search in google for the correct syntacs Link to comment Share on other sites More sharing options...
UEZ Posted September 2, 2011 Share Posted September 2, 2011 Try this: $usr = "administrator" $pwd = "Test" Run ("net use b: \\10.100.100.225\g /savecred /persistent:yes /user:" $usr & " " & $pwd) Br, UEZ KeyOne 1 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 More sharing options...
eds Posted September 8, 2011 Author Share Posted September 8, 2011 (edited) 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 September 8, 2011 by eds Link to comment Share on other sites More sharing options...
UEZ Posted September 9, 2011 Share Posted September 9, 2011 (edited) If you don't use the /savecred switch it should work! Br,UEZ Edited September 9, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now