Up until now, I've always disabled UAC. Now, I'd like to play by the book and leave it on.
My test case is getting
mkdir c:\program files\foo to work. When I run it (my user is an admin), I get
Access is denied.
runas /user:boom\administrator "mkdir c:\program files\foo", hoping this will help. I am prompted for a password. I hit ENTER, and get
RUNAS ERROR: Unable to run - mkdir c:\program files\foo 1327: Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced.
Fine, I try to setup a password for the administrator user. I look it up in the users tab in task manager or in User Accounts --> Manage another account, and it's not there.
How should I proceed? Is trying to run mkdir under administrator is even the right track? Should I try to run it under SYSTEM?
Update - OK, I found cmd.exe and right-clicked "run as Administartor", and was then able to change the password by running a privileged taskmgr from it. Still, when I run
runas /user:administrator "mkdir foo" and type the password I get the same error. This is a brand new laptop, not connected to a domain, and the admin password is not blank.
Update 2 - This is Win 7 64 bit professional, and I want to do this all from the command line. My goal is to create a simple "sudo.bat" script.