SQL Server Performance
  1. NewDBA New Member

    Hi ,
    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?
  2. satya Moderator

    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
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  3. NewDBA New Member

    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.
  4. webwarrior New Member

    Can you share the VB code with us, I need something simular.

Share This Page