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
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
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
Summary: I am trying to use Ghostscript in a batch file. Then I could right-click any PDF and do "Send To" GS conversion batch file. Software: AFPL Ghostscript 8.54 Windows XP SP1 (working as Restricte...
Summary: Do you mean you lost the "Send To" Outlook Express email option in Office? As in you are trying to email someone a spreadsheet/document from within Excel or Word? I use OE, but I don't have a "Send T...
Summary: Hi, I just built a system with a retail boxed K7n420 Pro, retail AMD XP 1900+, 400w powersupply, two sticks of Kingston 256mb 2100 DDR Ram, 20gig drive, Pioneer DVD, TDK CD-RW, Microsoft Optical mouse...