Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WSF Script or Batch File Help

Status
Not open for further replies.

jayjay66

Technical User
Oct 31, 2005
114

Hi,

I need help with a .WSF (Windows Script File) that I need to create. I need the script (macro) to do the following keystroke sequences in the folling order:


<CTRL-ALT-G>
<ALT-F>
<TAB>
<TAB>
<ALT-O>
<ENTER>
<ALT-G>
<ENTER>
<Y> (the letter>
<ENTER>


Can anybody help me? Am I in the right forum?

Please, any help would greatly appreciated. Basically, it's for a task that's done daily and I would like to automate it thru a script or batch file.

Please help.

Thanks,
JJ

 
You could try using SENDKEYS in VB script, but I would use this excellent scripting tool instead:

AutoIt -- Freeware

Your AutoIt script would be:

Send("^!g")
Send("!f")
Send("{TAB 2}")
Send("!o")
Send("{ENTER}y{ENTER}"}

Note, if you really need CAPITAL g, f o and y above, just edit what I have written to reflect this.
 
I am sorry, the last line should be:
Send("{ENTER}y{ENTER}")

 
The WSF equivalent would be:

'VB script of the above using SENDKEYS

<job id="vbs">
<script language="VBScript">

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.SendKeys "^(%g)"
WshShell.SendKeys "%(f)"
WshShell.SendKeys "{TAB 2}"
WshShell.SendKeys "%(o)"
WshShell.SendKeys "~y~"

</script>
</job>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top