hi all
I'm facing difficulty to create a CMD script to run an application like notepad as different user and I want the password to be saved so I don't have to write it
for example, <g class="gr_ gr_788 gr-alert gr_gramm Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="788" id="788">username</g> is test and password is 123
what i have been reached is (runas /user:test "C:\windows\Notepad.exe")
but it will ask for the password everytime I run it
kindly help me
Hi Hussain,
In order to solve your problem you can use /savecred as shown in the example below:
runas /user:[Domain Name]\[User Name] /savecred [Application Name]
In your example that would be:
runas /user\test /savecred notepad.exe
The first time you will be prompted for a password.
Once you enter the password, the next time you execute the command will not ask for it.
After that, you can create a .bat file and execute it at anytime without entering the password.
Hope this helps you !