SQL Server Performance Forum – Threads Archive
I try to use runas command in VB .Need it to run seemlesly without prompting password.
My command line looks like this: runas /profile /env /user:mydomainmyuser "c:winnt
otepad.exe" This way I am getting a prompt for password.
I tried : runas /profile /env /user:mydomainmyuser /P mypassword "c:winnt
otepad.exe" doesn’t work .
Could someone help?
I think this is by default as per this KBAhttp://support.microsoft.com/Default.aspx?kbid=225035 listed. As the RUNAS program does not have the parameter to specify the password – and you must enter the password. When a user logs on (including with RunAs), the system creates a new token for the user, determining at that time what groups the user is a member of and which privileges the user should have. Once a token is created, one can#%92t add or (generally) remove any groups or privileges from the token. Interesting points about RUNAS from thishttp://blogs.msdn.com/aaron_margosis/archive/2004/06/23/163229.aspx MSDN blog. HTH Satya SKJ
This posting is provided â€œAS ISâ€ with no rights for the sake of knowledge sharing.
Well this is truth but I did find perfectly working workaround http://www.tek-tips.com/faqs.cfm?fid=2760 It’s a VB script so I just modified it a bit to work in VB. The most important part in it is to make sure that there is waiting interwal before
submiting the password to the waiting dos window.(I used for it Sleep function)
Thought maybe someone will be interested… But thank you anyway ,Satya.
Can you share the VB code with us, I need something simular.