jump to navigation

Sendkeys con programas tontos June 28, 2013

Posted by hackandfab in Uncategorized.
trackback

Como automatizar programas ajenos en windows con Sendkeys

ej: meter esto en un fichero .txt y renombrarlo a .vbs
<code>
rem
rem Autoria, liencia y para que sirve.
rem

Set wshShell = CreateObject(“WScript.Shell”)

wshShell.Run wshShell.ExpandEnvironmentStrings(“””%PROGRAMFILES%\blabla\blabla\bla.exe”””)

rem en windows 7 %PROGRAMFILES(x86)%

Do Until Success = True
    Success = wshShell.AppActivate(“nombre_de_la_ventana_no_del_ejecutable”)
    Wscript.Sleep 1000
Loop

Wscript.Sleep 500
wshShell.SendKeys “{TAB}”
Wscript.Sleep 100
wshShell.SendKeys “{TAB}”
Wscript.Sleep 100
wshShell.SendKeys ” “
        rem asi se envia un espacio

Wscript.Sleep 100
wshShell.SendKeys “Parrafada del copon”
</code>
http://msdn.microsoft.com/en-us/library/8c6yea83%28v=vs.84%29.aspx

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: