Hacking - Impress Girl friend
Automated Messaging With Computers
- Windows Operating System has a dominant scripting environment called WSH (Windows Scripting Host) with support for JScript and VBScript. Other languages can as well be used in WSH, but the language installer needs to be downloaded and configured.
- The script files can be created with normal text editor such as notepad and saved with .vbs or .js extension. Double clicking the file invokes the process file, that is cscript.exe or wscript.exe. The process file name depends on the system settings. The cscript.exe outputs data to console (with WScript.Echo). The process wscript.exe will produce output as message dialog.
Benefits of WSH :
1.Compilation is not required for the script code.
2.Hence apt solution for trivial daily tasks with small functionalities.
3.The script file can be created and edited with simple text editor and hence distributed easily.
4.The scripts are independent of operating system version such as 32 bit or 64 bit.
- The following runs the notepad.exe and bring the notepad to the front. The second parameter 9 means: to active and display the window. If the window is minimized or maximized, the system restores it to its original size and position.
Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "notepad", 9 ' Give Notepad time to load WScript.Sleep 500 Dim Msg: Msg = "WikiTechy Hacking step by step tutorial" ' Type in One Character at a time For i = 1 To Len(Msg) WScript.Sleep 200 WshShell.SendKeys Mid(Msg, i, 1) Next
The code Set WshShell = WScript.CreateObject("WScript.Shell") creates an instance for WScript.Shell object (COM Automation Process).
WshShell.Run "notepad", 9 starts the notepad.exe in your machine and brings it to the front in the monitor. Parameter value 9 means that the process is activated and displayed, even if it is minimized or maximized state.
Dim Msg: Msg = "WikiTechy Hacking step by step tutorial" declares the variable Msg with the value “WikiTechy Hacking step by step tutorial”.
For i = 1 To Len(Msg) WScript.Sleep 200 WshShell.SendKeys Mid(Msg, i, 1) Next
- This for loop will work from loop values between 1 to length of the message, as indicated by the line For i = 1 To Len(Msg).
- The process is made to be inactive for 200 milliseconds by the code WScript.sleep 200.
- The SendKeys sends the message (Msg) to the active window. Here the mid statement has the following syntax:
Mid(stringvar, start[, length])
- Hence the line code WshShell.SendKeys Mid(Msg, i, 1), will send the character from the Msg, from the position indicated by the variable i, and of length 1. That is one character is chosen from the input string and sent to the active window.
- A new notepad is opened and message is typed character wise by the shell command as indicated in the figure above and below.