Batch File - Auto Proceed [Solved/Closed]

Taka - Oct 25, 2008 at 05:38 PM - Latest reply:  funkee
- Jan 14, 2010 at 06:29 AM

I'm creating a batch file to automatically run an setup.exe, the setup.exe requires Enter to be pressed once and then runs without assistance. Is it possible to have the batch file run the .exe and then automatically select enter for me?

See more 

3 replies

Best answer
Thank you
Hi Taka,

You can call a vbs file to press enter for you from the batch file.

.vbs file: (this file will sendkeys for enter button with a delay of 3000 milliseconds)

Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")

wscript.Sleep 3000

rem oshell.sendkeys "{Tab}" --- use this if you have to move you focus of the pointer

oshell.sendkeys "~" --- this is for enter button.

.bat file:

call "your exe file with actual path within quotes"

call "your vbs file with actual path within quotes"

Let me know if you face any problem....

Thank you, Hawk 13

Something to say? Add comment

CCM has helped 1705 users this month

Thank you for the answer above.. This has worked and been rather helpful.

I have created a batch file which starts by auto connecting to a Cisco vpn client. I needed to press the 'enter' key to accept the vpn security message.

Many other people on the net were looking for same thing.. you had the easiest and best answer.

Thank you
hi hi I kno how to do this

open note pad and paste this:

@echo off
echo Press any key
echo what is your username?
set /p user=
echo what is your password?
set /p pass=
If '%user%'=='Tspider4' goto gooduser
echo Press a key to exit
If '%pass%'=='youtube' goto good
echo Press a key to exit
echo GOOD
echo Wanna start notepad!?
set /p note=
If '%note%'=='yes' start notepad.exe
echo byebye

click save as ..... give the name "Program.bat" when u open this file u just follow what the batch file is saying...

"Press any key"

"what is your user name?"
(type this) Tspider4
"what is your password"
(type this) youtube
Wanna start notepad?
(type this) yes

(and notepad will open automatically....) now if u wish to open WINDOWS LIVE MESSENGER u just ha to rewrite this "echo Wanna start notepad!?" for "echo Wanna start msnmgr!?"

and rewrite this "If '%note%'=='yes' start notepad.exe" for "If '%note%'=='yes' start msnmgr.exe"