Have an account?

Monday, September 7, 2009

Windows Scripting

Facts: The Microsoft Windows Script Host (originally called Windows Scripting Host, but renamed for the second release) is an automation technology for Microsoft Windows operating systems that provides scripting capabilities comparable to batch files, but with a greater range of supported features.

It is language-independent in the sense that it can make use of different Active Scripting language engines. By default it interprets and runs plain-text JScript (.JS and .JSE files) and VBScript (.VBS and .VBE files).




Using Windows Scripting Host:

Set WshShell = WScript.CreateObject("WScript.Shell")
//Basic Structure

WshShell.Run " "
//Runs Anything within the quotes

WshShell.Sendkeys "{ }"
//Using codes to send qwerty keys within the braces.
E.g. WshShell.Sendkeys "{ENTER}"

WScript.Sleep 1000
//Awaits for 1 second...

Keys of Others:
Ctrl = ^
Shift = +
Alt = %
Windows Key = "^{ESC}"
By using "+{5}" within the braces, which is the same key as the %



WshShell.Regwrite " "
//Which writes entries to the registry.

Example :
WshShell.Regwrite "The Hive Key path + STRING, DWORD name and etc", 1, "REG_DWORD"

1 = value to be change.



WshShell.Popup (" ")
//Creates a popup to the system
E.g.

WshShell.Popup ("In box name", 20, "Title of the Popup box", 4)
"20" = 20seconds (User can change to any timing)
4 = Type of push button to use.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.