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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Key combination ALT+Print in VBscript

Status
Not open for further replies.

sbauerle

Technical User
Mar 14, 2002
17
DE
Hello,

can anybody tell me how to execute the ALT+Print key combination using VBscript.

thanks for any help
Stefan
 
In WSH (windows scripting host) there is the function sendkeys which
Sends one or more keystrokes to the active window as if typed at the keyboard.

e.g.

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"
WScript.Sleep 500
WshShell.SendKeys "2"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 500
WshShell.SendKeys "*3"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 2500
</script>

source:
===============
Security Forums
 
Thanks for the link,
but what I found there is that the PRTSC key can not be sent to an application.
 
doh! sorry about that. i only noticed it on the list of keys. seems a bit strange having it on the list of keys.

There's a 3rd party program called autoit that also does sendkeys type things. I have used it before cos sendkeys in vbscript is a bit pants. According to what i've read on google group, it supports the print screen button.


ref:

===============
Security Forums
 
i mean i've used it within wsh. cos you can compile autoit scripts into exe files and then call them from wsh.
you could use autoit to put the stuff on the clipboard and do whatever afterwards in vbscript. :)

hth ===============
Security Forums
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top