Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: 'SendKeys' automating wannabe with lack of reliable info

07 Jul 2017   #1

'SendKeys' automating wannabe with lack of reliable info

I'm writing a batch file to transcribe sound files while I'm sleeping, and I've found I just don't have the expertise to do it alone.

Here's what I've got now (6 hours in [I'm not really a programmer]):

cd ..\..
&& cd Program Files (x86)
&& cd audacity
&& start audacity.exe

#Dice audiofile, use pitchdetect on pieces, store solutions in file

&& cd ..
&& cd Finale NotePad 2012
&& start Finale NotePad.exe

#Output file into cleft 10 lane freeway

I actually made some progress, saying to myself (Yee hee) I'll be done by tomorrow, the 1200 songs I have to transcribe by next week, but I found my roadblock and I'm sitting at her right now. (Which, the why I didn't post under the audio thread is the actual question doesn't involve audio).

Writing the next part would require false keypad strokes to be registered to programs keyboard shortcuts. Someone on a forum said 'Sendkeys'! and that was five hours ago, and I have just not been able to get it to work. I guess you have to use .vbs and I have not been able to get one of those to run.

Here are some examples of tests I have run to 1. verify 'SendKeys' is a real thing and 2. learn syntax:


Set oWshShell = CreateObject("WScript.Shell")
oWshShell.sendkeys("Hello World")



  @echo off
color 0a
%SendKeys% {ENTER}
timeout /t 1 /nobreak >nul
goto :loop


Test 3:

@if (@CodeSection ==  @Batch)  @then

  @echo off
    set SendKeys=CScript //nologo //E:JScript "%~F0"
        %SendKeys% "{ENTER}"
    goto :loop


##.vbs + .bat
Test 4:

SendKeys "{ENTER}"

SendKeys "exit{ENTER}"
SendKeys "H"
SendKeys "exit H"

## .vbs
Test 5:

if (CodeSection = Batch) then

echo off

rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys= (CScript E:JScript) "%~F0"

rem Start the other program in the same Window
start "" /B cmd

%SendKeys% "echo off{ENTER}"

set /P "=Wait and send a command: " < NUL
ping -n 5 -w 1 > NUL
%SendKeys% "echo Hello, world!{ENTER}"

set /P "=Wait and send an Up Arrow key: [" < NUL
ping -n 5 -w 1 > NUL
%SendKeys% "{UP}"

set /P "=] Wait and send an Enter key:" < NUL
ping -n 5 -w 1 > NUL
%SendKeys% "{ENTER}"

%SendKeys% "exit{ENTER}"

goto :EOF

## .vbs

Test 6:

Dim ReturnValue, I 
ReturnValue = Shell("CALC.EXE", 1) 
AppActivate ReturnValue    
For I = 1 To 100    
SendKeys I &; "{+}", True   
Next I   
SendKeys "=", True    
SendKeys "%{F4}", True    

## .vbs+.bat
## ^tried . file extension

And none of 'em got through. Old bird's a piece of crap, I'm sick and tired of this. Save me, someone from dying before I finish.

Thank you

My System SpecsSystem Spec
07 Jul 2017   #2

win 8 32 bit

You can use the free autoit this has lots of built in functions but it also has a macro recorder that can record keystroke and mouse and it writes the code for you
My System SpecsSystem Spec

 'SendKeys' automating wannabe with lack of reliable info

Thread Tools

Similar help and support threads
Thread Forum
Automating a Word Document Index
Hi Everyone, I'd be very grateful if someone would let me know if it is possible to "automate" an index in a Word 2007 document please. By this I mean that any user, having selected a Title or Subject in the Index, can somehow click the adjacent page number, and be whisked away to that page...
Microsoft Office
Automating Disk Cleanup?
Has anyone been sussessulf in automating Disk Cleanup in Windows 7? Had it working nicely in XP before the upgrade but can't seem to get it working the way I'd like. TweakHound - How To Schedule Disk Cleanup To Run Automatically in Windows XP
General Discussion
Windows 7 Game Explorer lack of Icon Customization Lack
I am a very disatisfied new Windows 7 user. My problem specifically is related to the new Game Explorer for Windows 7. Windows 7 Game Explorer does not allow for Icon Customization. Not at all. I find this to be a horrendous problem. When trying to drag my game icons from the folders where the...

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 13:10.
Twitter Facebook Google+