Friday, June 25, 2010

Sendkeys

A VB Script to run outlook and send some specified keys to it.

To send Ctrl+n, use "^{n}" as given below, for Alt use %

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "Outlook"
WScript.Sleep 2500 ' Give Notepad some time to load
WshShell.SendKeys "^{n}"
WScript.Sleep 1000
WshShell.SendKeys "Yogesh_Gandhi@infosys.com"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys " Hi Yogesh, I accept that I am a FOOL ...and you made a fool out of me today ... I don’t think God planted brains in my head!!!!...otherwise I would have checked out the code first! you are great. hats off for you. With Regards"
WshShell.SendKeys "%{s}"

Thursday, June 24, 2010

Quick batch file to check OS version…

How to check the Operation System version
if OS is 32 bit or 64 bit

Quick batch file to check OS version…




@echo off

Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0

REG.exe Query %RegQry% > checkOS.txt

Find /i "x86" < CheckOS.txt > StringCheck.txt

If %ERRORLEVEL% == 0 (

Echo "This is 32 Bit Operating system"

) ELSE (

Echo "This is 64 Bit Operating System"

)

pause