Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a legacy application(with GUI) in our company. Because it needs to enter user and password to start manually, we can not automatically start it after reboot. We need a program to do this for us. Is there any such program?(starts a program enters user and password). We are using windows server 2008.

share|improve this question
Which operating system? – iglvzx Apr 16 '12 at 5:07
up vote 1 down vote accepted

You could potentially do this using VBScript. I know there's a SendKeys command that can send pretty much any kind of keyboard input to a program launched via the script.

Here's one way of using it:

set WshShell = WScript.CreateObject("WScript.Shell") "runas /user:domain\user %comspec%" 'Open command prompt  
WScript.Sleep 1000 
WshShell.SendKeys "password" 'send password   
WshShell.SendKeys "{ENTER}"    
WScript.Sleep 1000 

'Open IE 
  + Chr(34) 
WshShell.SendKeys "{ENTER}" 

WshShell.SendKeys "exit"  'Close command prompt 
WshShell.SendKeys "{ENTER}" 
WScript.Sleep 1000 

WshShell.SendKeys "{TAB}" 
WshShell.SendKeys "" 'Send internet page to open to IE 
WshShell.SendKeys "{ENTER}" 

Here's another method of using it without WshShell:

Dim ProcID As Integer
' Start the Calculator application, and store the process id.
ProcID = Shell("CALC.EXE", AppWinStyle.NormalFocus)
' Activate the Calculator application.
' Send the keystrokes to the Calculator application.
My.Computer.Keyboard.SendKeys("22", True)
My.Computer.Keyboard.SendKeys("*", True)
My.Computer.Keyboard.SendKeys("44", True)
My.Computer.Keyboard.SendKeys("=", True)
' The result is 22 * 44 = 968.
share|improve this answer

I'd recommend using the Windows 'Task Scheduler' or 'Scheduled Tasks' depending on your version of windows. It's great for starting programs or launching scripts without user intervention. You can configure your task to start based on different 'triggers' or 'events' such as time of day or after a reboot. It can do this without being logged on. Here is a tutorial that will show you how to setup a task to start a program following a system reboot. You may need to change a few of the perameters, but it's easy to use.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .