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
  pass arguments from bat file to pyhon script from application absolut 2 902 Jan-13-2025, 11:05 AM
Last Post: DeaD_EyE
  Trying to get JSON object in python and process it further Creepy 2 981 Oct-24-2024, 08:46 AM
Last Post: buran
  Error on first Python launch garryp4 5 3,621 May-07-2024, 03:56 PM
Last Post: deanhystad
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 7,876 Jun-29-2023, 11:57 AM
Last Post: gologica
  Launch Python IDLE Shell from terminal Pavel_47 5 2,539 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Question about Creating an Automated Process in Python Supratik1234 0 1,163 Jan-13-2023, 08:29 PM
Last Post: Supratik1234
  Using evdev for background script hotcocoa 1 2,152 Jun-19-2022, 10:41 PM
Last Post: hotcocoa
  Python running only in application Mawixy 2 1,780 Apr-19-2022, 11:38 AM
Last Post: Mawixy
  Process the image on the Python HTTP server Aleks 0 4,005 Dec-02-2021, 11:43 PM
Last Post: Aleks
  Python library for win32 console commands eldiener 3 4,644 Aug-24-2021, 10:28 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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