Skip to content

Commit 323e2ef

Browse files
committed
修复kill_5073中处理路径空格的问题
1 parent 023da07 commit 323e2ef

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

python/kill_5037.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ def win():
2222
#adb.exe 10200 Console 1 6,152 K
2323

2424
process_name = os.popen('tasklist /FI "PID eq %s"' %pid).read().split()[-6]
25-
process_path = os.popen('wmic process where name="%s" get executablepath' %process_name).read().split()[-1]
25+
process_path = os.popen('wmic process where name="%s" get executablepath' %process_name).read().split("\r\n")[1]
26+
2627
#分割路径,得到进程所在文件夹名
2728
name_list = process_path.split("\\")
2829
del name_list[-1]
2930
directory = "\\".join(name_list)
31+
3032
#打开进程所在文件夹
3133
os.system("explorer.exe %s" %directory)
3234
#杀死该进程

0 commit comments

Comments
 (0)