使用 Python 搜索安装在服务器上的程序

Using Python to search program installed on server

我想使用 Python 搜索 Projectwise(一个文档管理程序)。我认为这会起作用:

import subprocess  
subprocess.call("Projectwise.exe")  

但是,我的工作计算机上似乎没有本地安装 Projectwise。我无法从快捷方式打开原始文件位置。它可能安装在所有办公室计算机上。是否仍然可以在 Python 内调用 Projectwise?

编辑:我已经尝试找到应用程序位置,but the properties window doesn't show where the shortcut leads to.

您的问题是程序使用了 advertised shortcut。我建议你通过快捷方式 运行 应用程序,并在 运行ning 时使用任务管理器查找程序的位置。

然后,使用该路径作为 subprocess.call 的参数:

import subprocess as sp
sp.call("C:\Path\To\Projectwise.exe")