如何使用cmd从目录中提取文件版本信息?

时间:2015-06-23 05:57:40

标签: batch-file batch-processing

如何使用批处理脚本中的命令行提取目录中存在的文件的版本号?

2 个答案:

答案 0 :(得分:0)

您可以尝试使用powershell包装的批处理文件:

@echo off
echo.
set /p PathFile="Enter the absolute path to your application to retrieve its version > "
echo.
SET ScriptDirectory=%~dp0
SET ScriptPath=%ScriptDirectory%FileVersion.ps1 
echo (Get-Item '%PathFile%').VersionInfo.FileVersion > %ScriptPath%
cmd /k PowerShell -NoProfile -ExecutionPolicy Unrestricted -File ""%ScriptPath%""

答案 1 :(得分:0)

使用sigcheck实用程序提取文件版本信息。

我下载了大约290KB的sigcheck.exe,然后使用此命令获取文件版本信息:

SIGCHECK -a C:\ Program Files(x86)\ Software \ bin \ Software.exe

相关问题