Computer Hope

Microsoft => Microsoft DOS => Topic started by: Blackberry on April 06, 2008, 06:29:08 AM

Title: Runas command: auto fill password
Post by: Blackberry on April 06, 2008, 06:29:08 AM
Hi,
Does anyone know how to auto fill the password in the runas command in the console under windows vista.
E.G. I type runas /user:blackberry "cmd.exe", then I get the question give the password, but I would like to have that the batch file auto gives that password. Any ideas?

Thanks in advance

Blackberry  :)
Title: Re: Runas command: auto fill password
Post by: Sidewinder on April 06, 2008, 05:50:36 PM
You might try to pipe the password into the command. Don't know if it will work but do know that blank passwords are not accepted.

Code: [Select]
echo password | runas /user:blackberry "cmd.exe"

Code like this is a security breach and MS may disallow it. 8)

Does not the user parameter need to be in DOMAIN\USER format?
Title: Re: Runas command: auto fill password
Post by: blastman on April 07, 2008, 01:41:29 AM
sadly the 'runas' command won't let you pipe the password as it is as sidewinder has said and locked down as a security feature.

someone else asked this not to long ago. I think they got it working by using pstools, psexec is designed to run apps on remote machines, but i see no reason why you couldn't get it run on the local machine.

psexec will allow to hardcode a password into the batch.

hope it helps.