jump to navigation

Sendkeys con programas tontos June 28, 2013

Posted by hackandfab in Uncategorized.

Como automatizar programas ajenos en windows con Sendkeys

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

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

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”


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: