Python Forum
win32 API: Launch Application to RDP session from background process python script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
win32 API: Launch Application to RDP session from background process python script
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I properly implement restarting a multithreaded python application? MrFentazis 1 587 Jul-17-2023, 09:10 PM
Last Post: JamesSmith
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,009 Jun-29-2023, 11:57 AM
Last Post: gologica
  Launch Python IDLE Shell from terminal Pavel_47 5 1,143 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Question about Creating an Automated Process in Python Supratik1234 0 712 Jan-13-2023, 08:29 PM
Last Post: Supratik1234
  Using evdev for background script hotcocoa 1 1,273 Jun-19-2022, 10:41 PM
Last Post: hotcocoa
  Python running only in application Mawixy 2 1,091 Apr-19-2022, 11:38 AM
Last Post: Mawixy
  Python multiprocessing Pool apply async wait for process to complete sunny9495 6 6,220 Apr-02-2022, 06:31 AM
Last Post: sunny9495
  Process the image on the Python HTTP server Aleks 0 3,153 Dec-02-2021, 11:43 PM
Last Post: Aleks
  Python library for win32 console commands eldiener 3 3,384 Aug-24-2021, 10:28 PM
Last Post: bowlofred
  Win32\ping.exe windows pops up -very annoying... tester_V 9 3,127 Aug-12-2021, 06:54 AM
Last Post: tester_V

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020