How to keep 2 or more Remote Desktops active ?
When you have 2 machines say 1 for execution ( i.e., running automation scripts and the other to do day to day activity) or you might have access to run automation scripts in few machines , then there is a need to keep all the machine active.Below is the piece of code which can help you achieve this .
Dim i,sW_count,iTime_delay
set oShell =createobject("Wscript.Shell")
i=0
sW_count=Inputbox("Enter number of windows")
Redim Window_Name(sW_count-1)
For iCount=0 to sW_count-1
Window_Name(iCount)=inputbox("enter exact name as found in the Title box the window")
Next
iTime_delay=Inputbox("Enter time before next trigger in seconds") iTime_delay=iTime_delay*1000
For iCount=0 to sW_count-1
WScript.Sleep(500)
oShell.AppActivate(Window_Name(iCount))
WScript.Sleep(500)
oShell.SendKeys "% x" 'to maximize the window
next
do until i=1
for iCount=0 to sW_count-1
oShell.AppActivate(Window_Name(iCount))
WScript.Sleep(iTime_delay)
next
loop
How to use :
- Copy this piece of code in a text file and save it with an extension as ".vbs".
- Double click on the file.
- Enter how many windows you wish to keep alive.
- Enter the exact names of all the windows as on the title bar of the window E.g:CATCHBUG.blogspot.com - Windows Internet Explorer
- Enter after how many seconds you wish to trigger the window in seconds Eg: 120 (This will trigger each window after 120 seconds )
- To close this script open task manager kill the "wscript" process.
- This script should be used in conjunction with any key stroke or mouse simulation tool.
- This works only on windows platform.
No comments:
Post a Comment