Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Determine Version Compiler Compile EXE ToolsetBuildInfo File Property Compiletime
filename = DirScript():'a.exe' ret = FileVerInfo(filename, '', 'ToolsetBuildInfo' ) Pause( 'Version used to Compile this exe - ToolsetBuildInfo', ret ) ExitYou can also retrieve the compile date and time using:
filename = DirScript():'a.exe' ret = FileVerInfo(filename, '', 'CompileTime' ) Pause( 'CompileTime', ret ) Exit
These are (undocumented) custom strings added by the WinBatch+Compiler. These apply to a Compiled WinBatch Exe.
Compiletime ToolsetBuildInfo ToolsetCopyrightHere is a more complete code sample:
WbtPgm = IntControl(1004,0,0,0,0) If RtStatus() == 1 ;Compiled Exe Lang = "";'0asdasf' FileVersion = FileVerInfo(WbtPgm, Lang, "FileVersion" ) ProductVersion = FileVerInfo(WbtPgm, Lang, "ProductVersion" ) Comments = FileVerInfo(WbtPgm, Lang, "Comments" ) LegalCopyright = FileVerInfo(WbtPgm, Lang, "LegalCopyright" ) CompanyName = FileVerInfo(WbtPgm, Lang, "CompanyName" ) LegalTrademarks = FileVerInfo(WbtPgm, Lang, "LegalTrademarks" ) FileDescription = FileVerInfo(WbtPgm, Lang, "FileDescription" ) OriginalFilename = FileVerInfo(WbtPgm, Lang, "OriginalFilename" ) ProductName = FileVerInfo(WbtPgm, Lang, "ProductName" ) InternalName = FileVerInfo(WbtPgm, Lang, "InternalName" ) Msg = "FileVersion: ":FileVersion:@LF:"ProductVersion: ":ProductVersion:@LF:"Comments: ":Comments:@LF:"LegalCopyright: ":LegalCopyright:@LF:"CompanyName: ":CompanyName:@LF:"LegalTrademarks: ":LegalTrademarks:@LF:"FileDescription: ":FileDescription:@LF:"OriginalFilename: ":OriginalFilename:@LF:"ProductName: ":ProductName:@LF:"InternalName: ":InternalName Pause( "Resource Strings", Msg ) nFileVersion = FileVerInfo(WbtPgm, Lang, "#FileVersion" ) nProductVersion = FileVerInfo(WbtPgm, Lang, "#ProductVersion" ) nFileFlagsMask = FileVerInfo(WbtPgm, Lang, "#FileFlagsMask" ) nFileFlags = FileVerInfo(WbtPgm, Lang, "#FileFlags" ) nFileOS = FileVerInfo(WbtPgm, Lang, "#FileOS" ) nFileType = FileVerInfo(WbtPgm, Lang, "#FileType" ) nFileSubtype = FileVerInfo(WbtPgm, Lang, "#FileSubtype" ) Msg = "#FileVersion: ":nFileVersion:@LF:"#ProductVersion: ":nProductVersion:@LF:"#FileFlagsMask: ":nFileFlagsMask:@LF:"#FileFlags: ":nFileFlags:@LF:"#FileOS: ":nFileOS:@LF:"#FileType: ":nFileType:@LF:"#FileSubtype: ":nFileSubtype Pause( WbtPgm, Msg ) Compiletime = FileVerInfo(WbtPgm, Lang, "CompileTime" ) ; Special to WinBatch Compiled EXE ToolsetBuildInfo = FileVerInfo(WbtPgm, Lang, "ToolsetBuildInfo" ) ; Special to WinBatch Compiled EXE ToolsetCopyright = FileVerInfo(WbtPgm, Lang, "ToolsetCopyright" ) ; Special to WinBatch Compiled EXE Msg = "CompileTime: ":CompileTime:@LF:"ToolsetBuildInfo: ":ToolsetBuildInfo:@LF:"ToolsetCopyright: ":ToolsetCopyright Pause( WbtPgm, Msg ) Else Message( WbtPgm, "Sorry this script must be compiled into an EXE") EndIf Exit
Article ID: W17691
Filename: Determine Version of Compiler Used to Compile an EXE.txt
File Created: 2013:07:10:08:21:18
Last Updated: 2013:07:10:08:21:18