Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Runas

Runas

Scheduled Pinned Locked Moved System Admin
question
9 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vivekphlp
    wrote on last edited by
    #1

    IN windows Xp there is a command Runas /user .The password can be entered only when asked. Is there any way to give the password also with the Runas command?

    Proud To Be an India

    D 1 Reply Last reply
    0
    • V vivekphlp

      IN windows Xp there is a command Runas /user .The password can be entered only when asked. Is there any way to give the password also with the Runas command?

      Proud To Be an India

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Nope. How secure would it be if you could type your password in clear text on the command line?

      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      V 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Nope. How secure would it be if you could type your password in clear text on the command line?

        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        V Offline
        V Offline
        vivekphlp
        wrote on last edited by
        #3

        No Dave - iam not giving it directly from command prompt. Iam calling the command in a VBS file thro my VC++ program. IT works Option explicit dim oShell set oShell= Wscript.CreateObject("WScript.Shell") oShell.Run "runas /user:administrator ""PrintArt.exe""" WScript.Sleep 100 'Replace the string yourpassword~ below with 'the password used on your system. Include tilde oShell.Sendkeys "yourpassword~" Wscript.Quit

        Proud To Be an Indian

        D 1 Reply Last reply
        0
        • V vivekphlp

          No Dave - iam not giving it directly from command prompt. Iam calling the command in a VBS file thro my VC++ program. IT works Option explicit dim oShell set oShell= Wscript.CreateObject("WScript.Shell") oShell.Run "runas /user:administrator ""PrintArt.exe""" WScript.Sleep 100 'Replace the string yourpassword~ below with 'the password used on your system. Include tilde oShell.Sendkeys "yourpassword~" Wscript.Quit

          Proud To Be an Indian

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          vivekphlp wrote:

          iam not giving it directly from command prompt

          vivekphlp wrote:

          oShell.Run "runas /user:administrator ""PrintArt.exe"""

          How much do you want to bet you're not? This has some problems because you're waiting 100 (0.1) seconds, then sending the keys. What if the window takes longer than that to show up?? You just typed your password into another window, possibly Notepad?? :) Nice...you just typed your password, in clear text, into a TextBox.

          vivekphlp wrote:

          Iam calling the command in a VBS file thro my VC++ program.

          Why???? Why not just do the same thing in your VC++ app where you'll have much greater control?

          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          V 1 Reply Last reply
          0
          • D Dave Kreskowiak

            vivekphlp wrote:

            iam not giving it directly from command prompt

            vivekphlp wrote:

            oShell.Run "runas /user:administrator ""PrintArt.exe"""

            How much do you want to bet you're not? This has some problems because you're waiting 100 (0.1) seconds, then sending the keys. What if the window takes longer than that to show up?? You just typed your password into another window, possibly Notepad?? :) Nice...you just typed your password, in clear text, into a TextBox.

            vivekphlp wrote:

            Iam calling the command in a VBS file thro my VC++ program.

            Why???? Why not just do the same thing in your VC++ app where you'll have much greater control?

            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            V Offline
            V Offline
            vivekphlp
            wrote on last edited by
            #5

            Dave Kreskowiak wrote:

            Why???? Why not just do the same thing in your VC++ app where you'll have much greater control?

            Yes , I am now re-coding it to VC++, for time time being i can satisfy my clients with that.;)

            Proud To Be an Indian

            D 1 Reply Last reply
            0
            • V vivekphlp

              Dave Kreskowiak wrote:

              Why???? Why not just do the same thing in your VC++ app where you'll have much greater control?

              Yes , I am now re-coding it to VC++, for time time being i can satisfy my clients with that.;)

              Proud To Be an Indian

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              That's a nasty hack for something that you should be able to code in about 30 minutes.

              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007

              V 1 Reply Last reply
              0
              • D Dave Kreskowiak

                That's a nasty hack for something that you should be able to code in about 30 minutes.

                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007

                V Offline
                V Offline
                vivekphlp
                wrote on last edited by
                #7

                In just 30 min??? Thats great - can u just give me an idea of how to code that... plz

                Proud To Be an Indian

                D 1 Reply Last reply
                0
                • V vivekphlp

                  In just 30 min??? Thats great - can u just give me an idea of how to code that... plz

                  Proud To Be an Indian

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  Nope. I haven't touched C++ in quite a while. But, the functions are in the Win32 library. You're looking for CreateProcess, probably FindWindow, SendMessage, maybe even WriteConsole.

                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007

                  V 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    Nope. I haven't touched C++ in quite a while. But, the functions are in the Win32 library. You're looking for CreateProcess, probably FindWindow, SendMessage, maybe even WriteConsole.

                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007

                    V Offline
                    V Offline
                    vivekphlp
                    wrote on last edited by
                    #9

                    THanks DAVE For ur help ...

                    Proud To Be an Indian

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups