如何确定命令是否可执行?

时间:2018-01-06 13:39:59

标签: c# windows shell

如果在默认的Windows安装中运行命令shell,请键入mspaint并按Enter键,Paint启动。

有没有办法(以编程方式)确定命令是否可执行?

1 个答案:

答案 0 :(得分:3)

要分析给定文件,您可以使用dumpbin.exe作为Visual Studio的一部分分发的工具。

示例输出:

C:\>dumpbin z3.exe
Microsoft (R) COFF/PE Dumper Version 14.00.24213.1
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file z3.exe

File Type: EXECUTABLE IMAGE


C:\>dumpbin what.com
Microsoft (R) COFF/PE Dumper Version 14.00.24213.1
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file what.com
what.com : warning LNK4048: Invalid format file; ignored