Answer the question
In order to leave comments, you need to log in
Run BAT as administrator?
Good evening!
There was a problem - you need to run BAT as an administrator.
At first I tried to solve it through runas code.bat
(I don’t remember what else I wrote there).
There was nausea Введите пароль для Администратор:
.
The user will definitely delete the program. Found a solution with VBS and BAT:
code.bat :
net session 2>nul >nul
if not errorlevel 1 (
echo ==== Success: Administrator
pause >nul
) else (
code.vbs
exit /b
)
Set WshShell = CreateObject("Shell.Application")
WshShell.ShellExecute "code.bat", "", "", "runas", 0
Set WshShell = Nothing
Answer the question
In order to leave comments, you need to log in
runas /savecred
When launched with this key, a password entry window appears. Once entered, the password is remembered.
After that, you can simply run it, it will not ask for a password.
This key does not work in Windows 7 Home and Windows 7 Starter.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question