Answer the question
In order to leave comments, you need to log in
How to set a password in a bat file for the runas /user:Admin command?
Good afternoon!
There is a bat file that would like to restart the computer on the local network.
If you write it like this:
shutdown -r -f -t 0 -m \\MY-PC
Answer:
Access is denied. (5)
And if you try just like this:
runas /user:Admin "shutdown -r -f -t 0 -m \\MY-PC"
Then displays "Enter the password for Admin".
I know the password, but for some reason I can't enter it into the console window.
How can I write the password in the bat file?
Answer the question
In order to leave comments, you need to log in
Try admilink.ru/admilink.htm for a great solution to run as administrator.
where I'm too lazy to make a domain, I added a user to each computer - myself and transferred it to a service user.
the downside is that if you change your password at home, you have to change the password on all other computers manually.
PS: the domain is still better ... the way is even on samba
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question