CoffeeBean Posted December 31, 2012 Share Posted December 31, 2012 (edited) Can anyone tell me why this isn't working? I've included the debug code also. #include <File.au3> ; Not necessary for the block in question, but the goal of the script is to create some directories and install programs. #RequireAdmin ;Set up Administrator account and map necessary Drive $cmd = 'net user administrator /active:yes' RunWait (@ComSpec &'/k' & $cmd) ; @error = 1, @extended = 2 $pwd = 'net user administrator password' @error = 1, @extended = 2 RunWait (@ComSpec &'/k' & '$pwd') ; @error = 1, @extended = 2 DriveMapAdd ('j:', '\\server\share', 'administrator', 'password') ; @error = 6, @extended = 0 <== ostensibly so since the administrator is never getting set on line 3. I really appreciate your help! Edit: Added #RequireAdmin - Same result. Edited December 31, 2012 by CoffeeBean Link to comment Share on other sites More sharing options...
Quual Posted December 31, 2012 Share Posted December 31, 2012 try adding #RequireAdmin CoffeeBean 1 Link to comment Share on other sites More sharing options...
Danny35d Posted January 1, 2013 Share Posted January 1, 2013 You forgot the space between the /k and the single quote.RunWait (@ComSpec &'/k' & $cmd)should beRunWait (@ComSpec &'/k ' & $cmd) CoffeeBean 1 AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
Developers Jos Posted January 1, 2013 Developers Share Posted January 1, 2013 You forgot the space between the /k and the single quote.RunWait (@ComSpec &'/k' & $cmd)should beRunWait (@ComSpec &'/k ' & $cmd)You also need a space before the /K CoffeeBean 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
CoffeeBean Posted January 2, 2013 Author Share Posted January 2, 2013 Spaces? >_< Thanks Quaal, Danny and Jos - the spacing around ' /k ' fixed it! 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