Remote PC running application fails when RDP window is closed.
i have vbscript called application opens web site, navigates download area , downloads file. when have rdp console open works fine if close application stops when download dialog opens.
the script uses mshtml controls until opens "file download" dialog. script executes several sendkeys commands, pauses, waits download complete, closes browser session , ends.
when rdp window open executes flawlessly if window closed , script starts, reaches "file download" dialog , stops. application closes browser window sucessfully , ends, leaving "file download" dialog displayed on desktop.
does windows treat closed rdp desktop differently regular desktop? unique keystroke emulation?
wshshell.appactivate "file download"
wscript.sleep 3500
'tell save
wshshell.sendkeys "{left}"
wshshell.sendkeys "{enter}"
do while objie.busy
wscript.sleep 1000
loop
'give filename of default file
wshshell.sendkeys sfilename
'start download
wshshell.sendkeys "{enter}"
'wait finish
do while objie.busy
wscript.sleep 1000
loop
wscript.sleep 5000
'close download complete window
wshshell.sendkeys "{enter}"
do while objie.busy
wscript.sleep 1000
loop
'back browser window
resetwindow
objie.quit
hi,
that's interesting problem, suspect problem because when rdp client disconnected, remote session (where script running) no longer has keyboard "attached". rdp acts keyboard when client connected.
i don't believe there's out there automate window actions through script, without keypresses. if you're familiar .net framework coding, should able use of apis automate window actions doing things 'findwindow', , 'clickbutton'. there's rich set of .net ui automation code available: http://msdn2.microsoft.com/en-us/library/ms747327.aspx , ui automation should work whether rdp client connected or not.
hope helps,
drew
Windows Server > Remote Desktop Services (Terminal Services)
Comments
Post a Comment