通过命令提示符获取版本 [英] Get version by command prompt
本文介绍了通过命令提示符获取版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
如何通过批处理文件在文本文件中写入文件的版本?
我尝试了什么:
有一个批处理文件,用于在文本文件中写入指定文件的版本。
Hi
how write version of a file in a text file, by a batch file?
What I have tried:
have a batch file that writes version of a specified file in a text file.
推荐答案
对于那些没有看到你之前的问题的人来说,这很难回答如何在编译时知道DLL版本? [ ^ ]
使用来自SysInternals套件的 sigcheck 实用程序:
This would be hard to answer for anybody that has not seen your previous question How do I know the DLL version, in compile time?[^]
An example using the sigcheck utility from the SysInternals suite:
@ECHO off
REM Specify source directory of your project here
SET outputdir=c:\projects\myproject\
REM Execute sigcheck to print only file version and redirect to a temp file
path-to-sigcheck\sigcheck -n -q path-to-dll >%outputdir%temp.txt
REM Get file content into a variable
SET /p FILEVER=<%outputdir%temp.txt
REM Create header file
ECHO #pragma once > %outputdir%dll_ver.h
ECHO #define MY_DLL_VERSION _T("%FILEVER%") >> %outputdir%dll_ver.h
REM Uncomment to show the created file
REM type %outputdir%dll_ver.h
将 _T()
宏添加到打印到头文件的字符串中。
[/ EDIT]
Added the _T()
macro to the string printed to the header file.
[/EDIT]
这篇关于通过命令提示符获取版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文