获取CMD命令行的返回值
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ;少轻狂编写于2015-07-02 ;NSIS中文论坛www.nsisfans.com Name "CMD2LOG" Caption "$(^Name)" OutFile "CMD2LOG.exe" RequestExecutionLevel admin XPStyle on !include "MUI2.nsh" !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_LANGUAGE "SimpChinese" ShowInstDetails Show BrandingText "www.nsisfans.com" Section ExecDos:: exec 'cmd /c wmic csproduct list full |find "UUID"' "" "$EXEDIR\UUID.txt" ClearErrors FileOpen $0 $EXEDIR\UUID.txt r IfErrors done FileRead $0 $1 FileClose $0 MessageBox MB_OK "$1" done : SectionEnd |
文章来源:nsisfans