Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows paths issue
#4
You don't give full path when shall close the process.
It's only name vlc.exe or PID.
Don't need "\" before the path.

import subprocess

subprocess.Popen([r"C:\Program Files\VideoLAN\VLC\vlc.exe"])
Kill💀
import subprocess

process = subprocess.run("taskkill /im vlc.exe", capture_output=True, encoding='utf-8')
print(process.stdout)
Output:
SUCCESS: Sent termination signal to the process "vlc.exe" with PID 21356.
Reply


Messages In This Thread
Windows paths issue - by otalado - May-29-2022, 03:37 AM
RE: Windows paths issue - by Gribouillis - May-29-2022, 07:22 AM
RE: Windows paths issue - by ibreeden - May-29-2022, 07:53 AM
RE: Windows paths issue - by snippsat - May-29-2022, 09:11 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pdf2image, poppler and paths jehoshua 18 15,731 Jun-14-2022, 06:38 AM
Last Post: jehoshua
  automatically get absolute paths oclmedyb 1 2,200 Mar-11-2021, 04:31 PM
Last Post: deanhystad
  chkFile with absolute paths JarredAwesome 7 3,123 Sep-21-2020, 03:51 AM
Last Post: bowlofred
  Paths millpond 12 5,427 Jul-30-2020, 01:16 PM
Last Post: snippsat
  Problems with windows paths delphinis 6 5,468 Jul-21-2020, 06:11 PM
Last Post: Gribouillis
  Shortest paths to win snake and ladder sandaab 5 4,385 Jun-30-2019, 03:20 PM
Last Post: sandaab
  How to handle paths with spaces in the name? zBernie 1 6,859 Nov-22-2018, 04:04 AM
Last Post: ichabod801
  Question: Paths and writing to a file mwmaw 6 6,663 Dec-20-2016, 03:44 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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