Friday 30 April 2010

Sloooow Friday

So slow that i started tinkering with windows script files
Managed to automate logging in to programs that ask for a password at start up. It does mean the pw is kept in the script, but saves a whole 3 seconds! 

<package>
<job id="vbs">
<script language="VBScript">
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run """C:/""", 3 *** change C:/ to directory of program***
WScript.Sleep 100
WshShell.AppActivate "" ***name of prompt window ***
WScript.Sleep 100
WshShell.SendKeys "{TAB}" *** tabs to the password field - login ID stored***
WshShell.SendKeys "PW" ***change PW to your password ***
WScript.Sleep 100
WshShell.SendKeys "~"
WScript.Sleep 100
</script>
</job>
</package>

3 seconds, 5 times a day, 20 times a month does not add up to the time it took to work out how to do it...

MSDN is useful

No comments:

Post a Comment