Batch File - Auto Proceed

Solved/Closed
Taka - Oct 25, 2008 at 05:38 PM
 funkee - Jan 14, 2010 at 06:29 AM
Hello,

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?

Cheers.
Related:

2 responses

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....
13
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.

thanks
0
hi hi I kno how to do this



open note pad and paste this:

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


......................................................................................................
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
GOOD
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"
1