Runas
-
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
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 -
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, 2007No 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
-
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
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 -
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 -
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
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 -
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 -
In just 30 min??? Thats great - can u just give me an idea of how to code that... plz
Proud To Be an Indian
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 -
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