I was writing a simple batch file with the following command
net user Abhi *
where Abhi is my username and I am the administrator of my computer. On execution, it prompts for a password and then exits with Access is denied error. I know it requires administrator privileges, but don't know how to do it.
I tried it using:
runas administrator net user abhi *
But it did not work.
How do I run this command successfully (as admin)?
Runasis a single word. – techie007 Jun 2 '12 at 18:25C:\runas /user:username\administrator cmdafter this it will ask for password if you have set any type it and if it gives the error then you can try only hitEnterwhen it prompt for password. Then you can runnet user ABhi*. – avirk Jun 2 '12 at 18:49>after `C:` Its my fault sorry for that but console will not leave it. ;) – avirk Jun 2 '12 at 23:58