简体   繁体   English

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

[英]How to determine if command is executable?

If you run command shell in default Windows installation, type mspaint and press Enter, Paint starts. 如果在默认的Windows安装中运行命令外壳程序,请键入mspaint并按Enter键,Paint将启动。

Is there a way to (programatically) determine, whether a command is executable? 有没有办法(以编程方式)确定命令是否可执行?

To analyze a given file, you can use the dumpbin.exe tool distributed as part of Visual Studio . 要分析给定文件,可以使用作为Visual Studio的一部分分发的dumpbin.exe工具。

Example outputs: 输出示例:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM