Hello,
my company has several pcs located around the company (different countries etc), each of these pcs is running a drone software
ie doing set up predefined steps, data entry, button clicks etc, to simulate the use of different applications
the time taken to run these scripts is recorded and shown on a dashboard - so network issues can be highlighted.
the first part of the drone script logs into a terminal server and from there accesses various environments.
the problem we have encountered is that sometimes the terminal server session hangs, so when the next script comes along it is unable to complete as the data on the screen is not matching what the script is looking for.
I have written small vbs script to try and send 'alt+ctrl+end' to the terminal server session (to bring up the 'windows security' menu) followed by 'alt+l' to logoff the terminal session - so that the next time the script runs it starts with a clean terminal server session.
but the vbs script does not appear to be working - see script below
Set objWshShell = Wscript.CreateObject("WScript.Shell")
WScript.Sleep(5) ' Give some time to load
While 1 = 1
check = objWshShell.AppActivate("mstsc")
If check = true then objwshshell.Sendkeys("%^{END}")
objwshshell.Sendkeys("%+'l'")
Wscript.Sleep(10)
Wend
WScript.Quit
I am crawling my way through understanding vbscripting and have copied code from google.
any pointers would be much appreciated
regards rob
my company has several pcs located around the company (different countries etc), each of these pcs is running a drone software
ie doing set up predefined steps, data entry, button clicks etc, to simulate the use of different applications
the time taken to run these scripts is recorded and shown on a dashboard - so network issues can be highlighted.
the first part of the drone script logs into a terminal server and from there accesses various environments.
the problem we have encountered is that sometimes the terminal server session hangs, so when the next script comes along it is unable to complete as the data on the screen is not matching what the script is looking for.
I have written small vbs script to try and send 'alt+ctrl+end' to the terminal server session (to bring up the 'windows security' menu) followed by 'alt+l' to logoff the terminal session - so that the next time the script runs it starts with a clean terminal server session.
but the vbs script does not appear to be working - see script below
Set objWshShell = Wscript.CreateObject("WScript.Shell")
WScript.Sleep(5) ' Give some time to load
While 1 = 1
check = objWshShell.AppActivate("mstsc")
If check = true then objwshshell.Sendkeys("%^{END}")
objwshshell.Sendkeys("%+'l'")
Wscript.Sleep(10)
Wend
WScript.Quit
I am crawling my way through understanding vbscripting and have copied code from google.
any pointers would be much appreciated
regards rob