i'd use "sendkeys" rdp session, think i'd first need put focus on rdp window on desktop. how can determine dynamically? if use appactivate, how can determine name of rdp session?
appactivate window manipulation function available script. general rule programs don't mess other programs' windows.
however tasklist /v lists main window title program.
this code gets cmd.
set inp = wscript.stdin set outp = wscript.stdout set cmd = createobject("wscript.shell").exec("cmd") cmd.stdin.writeline "tasklist /fi ""imagename eq mstsc.exe"" /v" wscript.sleep 2000 cmd.stdin.writeline "exit" while not cmd.stdout.atendofstream results = cmd.stdout.readall if err.number <> 0 exit wscript.echo results loop also see article here on how access api vbs using vb.net. https://social.msdn.microsoft.com/forums/en-us/df0248cb-612f-4e2f-9665-11c68c401458/this-is-how-to-call-win32-api-calls-in-vbscript-and-jscript-sample-windows-api-functions?forum=scripting
and how find window title of active(foreground) window using window script host
Comments
Post a Comment