python – os.startfile’operation’参数有哪些“命令动词”可用,它们有什么作用?

根据Python documentation,os.startfile有两个参数:path和operation.路径描述得很好并且不言自明,但是对于操作来说,所有这一切都是:

When another operation [(not 'open')] is given, it must be a “command verb” that specifies what should be done with the file. Common verbs documented by Microsoft are 'print' and 'edit' (to be used on files) as well as 'explore' and 'find' (to be used on directories).

这意味着存在其他命令动词.还有其他可用的命令动词吗?如果是这样,他们是什么,他们做了什么?

具体来说,我想知道与“打开文件位置”操作相关的命令动词.

解决方法:

由于所有startfile基本上都是来自shell32的call to ShellExecuteW,所以这不是特定于Python的.

Microsoft docs indicate ShellExecute系列函数中可用的操作(“动词”)取决于确切的系统(注册表).根据该页面,“常用动词”是:

>编辑 – 启动编辑器并打开文档进行编辑.
> find – 从指定目录开始搜索.
> open – 启动一个应用程序.如果此文件不是可执行文件,则会启动其关联的应用程序.
> print – 打印文档文件.
> properties – 显示对象的属性.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...