Facebook

For any corporate training requirements Please mail To sudhakar@qtpsudhakar.com
New Schedule in MindQ Systems, Madhapur By SUDHAKAR
Course Name Date Time Duration Type Branch
Selenium+Appium 16th October 2017 7.30 AM - 9.00 AM IST 45 Days ClassRoom + Online Mind Q Madhapur
Selenium+Appium 30th October 2017 9.30 AM - 11.00 AM IST 45 Days ClassRoom + Online Mind Q Madhapur

A book "Cracking the QTP interview" authored by Sudhakar.Read More. Buy From FlipKart

Monday, January 23, 2012

WSH Scripting Samples

'***************************************************
'How to popup a message with some wait
'***************************************************
Set WshShell = CreateObject( "WScript.Shell")
WshShell.Popup "message body", 5, "Title"
 
'***************************************************
'How to get the current UserName of logged in
'***************************************************
Set WshNetwork = CreateObject( "WScript.Network")
userName = WshNetwork.username
Set WshShell = CreateObject( "WScript.Shell")
WshShell.Popup userName , 50, " userName "
 
'***************************************************
'How to send keyboard inputs to application
'***************************************************
set WshShell = CreateObject( "WScript.Shell")
WshShell.SendKeys "QuickTest Professional"
 
'***************************************************
'How to get the value of the system environment variable
'***************************************************
Set WshShell = CreateObject( "WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM" )
WScript.Echo WshSysEnv("NUMBER_ OF_PROCESSORS" )
 
'***************************************************
'How to write and read registry
'***************************************************
Set WshShell = CreateObject( "WScript.Shell")
WshShell.RegWrite "HKCU\Software\ ACME\FortuneTell er\", 1, "REG_BINARY"
WshShell.RegWrite "HKCU\Software\ ACME\FortuneTell er\MindReader" , "Goocher!", "REG_SZ"
bKey = WshShell.RegRead( "HKCU\Software\ ACME\FortuneTell er\")
msgbox WshShell.RegRead( "HKCU\Software\ ACME\FortuneTell er\MindReader" )
 
'***************************************************
'How to execute DOS commands
'***************************************************
Set oShell = CreateObject ("WSCript.shell" )
oShell.run "cmd /K CD C:\ & Dir"
'***************************************************

 _______________________________________
Please send your Suggestions and Doubts to my yahoo group http://in.groups.yahoo.com/group/qtpsudhakar

No comments :

Post a Comment