Facebook

For any corporate training requirements Please mail To sudhakar@qtpsudhakar.com
Course Name Date Time Duration Type Location
An important update from QtpSudhakar. I stopped giving classroom training in MindQ Systems. I have bigger plans and I want to put an end to regular classroom training because very less people are practicing. From now onwards every session of mine is going to have explanation and practice. Everyone should practice in presence of mine and should go out of classroom with practical knowledge. So I started my own institute AnyTechLabs in Madhapur. Please reach out to +91-8328152362 for course details. Visit AnyTechLabs.com for address details.
Selenium + Cucumber 24th October 7.30 AM IST to 9.00 AM IST 45 Days WeekDay Online

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