Python Forum

Full Version: win32 API: Launch Application to RDP session from background process python script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am trying to launch the application in RDP session from the background process which is python script. Here background script and RDP session is same user.

I tried win32process.CreateProcess but it runs application in background.

si = win32process.STARTUPINFO()
si.dwFlags = win32process.STARTF_USESHOWWINDOW
si.wShowWindow = win32con.SW_SHOW
si.lpDesktop = 'winsta0\default' 

procHandles =  win32process.CreateProcess(None,'notepad',None, None, 0,win32process.CREATE_NEW_CONSOLE, None, None, si)
Other option I tried is win32process.CreateProcessAsUser. But for it I need RDP user token by calling function win32ts.WTSQueryUserToken and it required special privilege to get the access token for user RDP session. Which user account doesn't have.

Is there any way I can achieve it.


Thanks
Rangesh