Computing.Net > Forums > Windows XP > Sending KeyStrokes Fr Within Batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Sending KeyStrokes Fr Within Batch

Reply to Message Icon

Name: moshe lubi
Date: November 28, 2008 at 03:57:10 Pacific
OS: Win XP Prof
CPU/Ram: Pentium-4, 512Mb RAM
Product: Intel /Microsoft
Comment:

Hello All, I need to emulate Keybord Key-Strokes inside an executing batch script (cmd.exe). Here's an example;
@echo off
if exist errcompile.exe goto errco
if exist errsend.exe goto errse
echo There Were No Errors
goto fin1
:errco
echo Preparing And Printing An Error Report
start errcompile.exe < {ENTER}
goto fin1
:errse
echo Sending Oper Analisys
start errsend.exe < {S}
:fin1
exit
REMARKS: errcompile.exe and errsend.exe are two closed pogram packages, that when double clicked,they show a window with some choices to make; In case of "errcompile" the message showing in the box says:"Press C to Compile, "Press ENTER to Compile & Print"
Assuming that this partic job will "always" want to COmpile and Print,the routine will always have to emulate pressing the ENTER key,that's why I put the < {ENTER} function sas can be seen on the 8'th line of the script.I do not know if such a possibility exists. I did the < {ENTER} for illustrative purposes :-) Thank's Lubi



Sponsored Link
Ads by Google

Response Number 1
Name: jefro
Date: November 28, 2008 at 13:27:56 Pacific
Reply:

You can't put the enter in the batch. You have to use a keyboard program to input that keystroke while in the other programs. Dos had it and I assume it would still work. I'm sure there are other ways too.

"Best Practices", Event viewer, host file, perfmon, antivirus, anti-spyware, Live CD's, backups, are in my top 10


0

Response Number 2
Name: moshe lubi
Date: November 29, 2008 at 11:09:49 Pacific
Reply:

Hi Jefro,Thamk you Very Much for your reply.
Quoting your remark;"...You have to use a keyboard program to input that keystroke while in the other programs..." Accordingly I modify my Example in which you will see that I have replaced the "< {ENTER}" with a Keystroke routine ready to send the "enter" code, when prompted for it, by some program;
@echo off
if exist errcompile.exe goto errco
if exist errsend.exe goto errse
echo There Were No Errors
goto fin1
:errco
echo Preparing And Printing An Error Report
start errcompile.exe
REM Here is a Keystroke Routine ready to
REM send am "ENTER" code, when prompted
REM for it by some event
goto fin1
:errse
echo Sending Oper Analisys
start errsend.exe < {S}
:fin1
exit
REMARKS: errcompile.exe and errsend.exe are two closed pogram packages, that when double clicked,they show a window with some choices to make; In case of "errcompile" the message showing in the box says:"Press C to Compile, "Press ENTER to Compile & Print"
Assuming that this partic job will "always" want to COmpile and Print,the routine will always have to emulate pressing the ENTER key,that's why I put the Keystroke program (as seen on the 8'th line of the script)that will send the needed "ENTER" code. Thank's Lubi


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


small problem PC Slow When Connected to...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Sending KeyStrokes Fr Within Batch

via Send To convert PDF to JPEG i www.computing.net/answers/windows-xp/via-send-to-convert-pdf-to-jpeg-i/155405.html

Send to in outlook express missing www.computing.net/answers/windows-xp/send-to-in-outlook-express-missing/175268.html

MSI K7n420 Pro, slow jerky video, LAN www.computing.net/answers/windows-xp/msi-k7n420-pro-slow-jerky-video-lan/23168.html