我如何从命令行在Windows中打开哪个文件?


Answers:


-3

您是指当前正在运行的流程吗?那将是:tasklist

如果要查看当前用户的运行进程:

tasklist /FI "username eq user"

更改user并放入当前用户名。


下选民可以解释一下吗?
Ruel

6
不是拒绝投票的人,而是您的答案根本不适用:退出问题明确指出需要文件列表,而不是进程列表。
user5028

好吧,我认为这就是他的意思(过程)。谢谢您的解释。
Ruel

Ruel您有任何想法吗,我如何实现如何关闭正在某些进程下运行的文件,例如

ruby.exe pid:556 TIGOC \ x0138466 744:文件(RW-)C:\ DOCUME〜1 \ x0138466 \ LOCALS〜1 \ Temp \ CGI.556.1 748:文件(RW-)C:\ Documents and Settings \ x0138466 \本地设置\温度74C:文件(RW-)C:\ DOCUME〜1 \ x0138466 \ LOCALS〜1 \ Temp \ mongrel.556.0 760:文件(RW-)C:\ InstantRails-2.0-win \ rails_apps \ upload \ log \ development.log 784:文件(RW-)C:\ WINDOWS \ WinSxS \ x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03 7B0:文件(RW-)C:\ InstantRails-2.0-win \ rails_apps \ upload \ log \ development.log

19

如果您需要命令行工具,则可以使用SysInternals 的Handle实用程序来完成。对于GUI工具,请查看Process Monitor


我想知道的另一件事是,可以关闭使用句柄在特定进程下运行的文件,我不想关闭进程,而是要打开一个文件。

1
@AMIT:handle -c <handle id> -p <process id>

ruby.exe pid:556 TIGOC \ x0138466 744:文件(RW-)C:\ DOCUME〜1 \ x0138466 \ LOCALS〜1 \ Temp \ CGI.556.1 748:文件(RW-)C:\ Documents and Settings \ x0138466 \本地设置\温度74C:文件(RW-)C:\ DOCUME〜1 \ x0138466 \ LOCALS〜1 \ Temp \ mongrel.556.0 760:文件(RW-)C:\ InstantRails-2.0-win \ rails_apps \ upload \ log \ development.log 784:文件(RW-)C:\ WINDOWS \ WinSxS \ x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03 7B0:文件(RW-)C:\ InstantRails-2.0-win \ rails_apps \ upload \ log \ development.log

ars ruby​​.exe是使用pid 556运行的进程,从那里我必须删除编号7444的文件,该怎么做而不关闭ID为556的ruby.exe

处理-p 556 -c 744
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.