Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Inputting username and password on one line  (Read 2810 times)

0 Members and 1 Guest are viewing this topic.

yazooney

    Topic Starter


    Newbie

    Inputting username and password on one line
    « on: March 27, 2008, 09:20:57 AM »
    hi,

    I want to be able to input the username and password within dos on one line. Basically, whenver i am in dos, and i am prompted for a password, i don't have to type the password on a seperate line.

    For example, instead of:

    Code: [Select]
    C:\> 'runas /user:home\yazooney explorer.exe'
    Enter the password for home\yazooney: 'PASSWORD'

    I want to be able to do:
    Code: [Select]
    C:\> 'runas /user:home\yazooney explorer.exe & PASSWORD'
    However, using the & function for doing mulitple commands on one line does not work.

    Anyone know a way of solving this problem?

    blastman



      Hopeful

      Re: Inputting username and password on one line
      « Reply #1 on: March 27, 2008, 10:48:02 AM »
      the 'run as' command won't let you automate the password.

      You will HAVE to enter it manually. (it's a security thing....)


      you could use pstools, that will allow the password to be entered on the same line.


      hope it helps. :)

      ** my 2 cents **

      Blastman, you are the man. Thank You Very Much!!!!!!!!!



      yazooney

        Topic Starter


        Newbie

        Re: Inputting username and password on one line
        « Reply #2 on: March 27, 2008, 11:20:22 AM »
        Thanks for the reply. Currently having a look at this pstools thing. As you can imagine, i not that much clued up.

        Any chance you can give me an example of how this would work?

        blastman



          Hopeful

          Re: Inputting username and password on one line
          « Reply #3 on: March 27, 2008, 11:33:20 AM »
          sure;

          in a dos prompt navigate to the pstools folder and run;

          "start psexec C:\path\to\program -u username - password"

          it's mainly used for running apps on remote machines but I see no reason why it won't run locally.

          You might have to put in \\%localhost% between the psexec and the path to program bit.


          Blastman, you are the man. Thank You Very Much!!!!!!!!!



          ferretman

          • Guest
          Re: Inputting username and password on one line
          « Reply #4 on: March 29, 2008, 05:13:01 AM »
          I would have thought you could echo the password but just pipe it into the runas command, like this:

          Code: [Select]
          echo PASSWORD | runas /user:admin cmd.exe
          I didn't try it but it should work, I think...