标题: 【已解决】(急)15元改一个成品:因为变量延迟,输出的字符串里叹号都没了 [打印本页]
作者: wheat611 时间: 2013-12-17 13:31 标题: 【已解决】(急)15元改一个成品:因为变量延迟,输出的字符串里叹号都没了
本帖最后由 wheat611 于 2013-12-18 09:31 编辑
具体报酬:15元人民币
支付方式:支付宝转账,网银转账。
联系方式:QQ 56667011
有效期限:13/12/18之前
需求描述:
下面是某.bat文件全文。
第79行输出语句 ECHO;!str1!>>"!curPath!\tmp.c"里面,把叹号全删掉了,但是变量延迟我不会改。
改一下能原样输出就行。- @ECHO OFF
- SETLOCAL ENABLEDELAYEDEXPANSION
-
- SET "curPath=%CD%"
- SET "aFolder=adlint\"
- SET "var1=/usr/include"
- SET "var2=#include"
- SET "var3=!curPath:\=/!"
- SET "var3=!var3!/copy/usr/include"
- SET "var4=common\interface\include"
- SET "HEXE=%1"
-
-
- IF "!HEXE!" EQU "" (
- ECHO Hidemaru is searching...
- FOR %%i IN ("C:\Program Files") DO (
- FOR /F "delims=" %%B IN ('DIR /S /B %%i\Hidemaru.exe') DO (
- IF EXIST "%%B" (
- SET "HEXE=%%B"
- GOTO START
- )
- )
- )
- )
-
- :START
- SET "HEXE=%HEXE:"=%"
-
- IF NOT EXIST "log.txt" (
- ECHO 【log.txt】is none!
- PAUSE&&EXIT
- )
-
-
- :CCHECK
- ECHO.
- IF EXIST "!curPath!\tmpchk.txt" (DEL /F /S /Q "!curPath!\tmpchk.txt">NUL)
-
- FOR /F %%A IN ('FINDSTR .* "!curPath!\log.txt"') DO (
- CD /D %%A
-
- FOR /R %%i IN (*.c) DO (
- "!HEXE!" /h /x"!curPath!\cmd\MakeNoBom.mac" /a"%%i"
-
- FOR /F "tokens=1* delims=:" %%A IN ('FINDSTR /N .* "%%i"') DO (
- SET "str1=%%B"
- IF NOT "!str1!" EQU "" (
- IF /I "!str1:~0,8!" EQU "!var2!" (
- CALL SET "str2=%%str1:!!var1!!=%%"
- IF NOT "!str1!" EQU "!str2!" (ECHO %%i>>"!curPath!\tmpchk.txt")
- )
- )
- )
- )
- )
-
- IF EXIST "!curPath!\tmpchk.txt" (
- FOR /F %%A IN ('FINDSTR .* "!curPath!\tmpchk.txt"') DO (
- ECHO %%A
-
- REM C file path and name is written.
- FOR %%i IN ("%%A") DO (
- CALL :SHOW %%i
- SET "cPath=%%~dpi"
- )
-
- REM rollback at last.
- COPY /Y "%%A" "!curPath!\copy">NUL
-
- IF EXIST "!curPath!\tmp.c" (DEL /F /S /Q "!curPath!\tmp.c">NUL)
-
- REM change the path
- FOR /F "tokens=1* delims=:" %%i IN ('FINDSTR /N .* "%%A"') DO (
- SET "str1=%%j"
- IF DEFINED str1 (
- IF /I "!str1:~0,8!" EQU "!var2!" (
- CALL SET "str2=%%str1:!!var1!!=%%"
- IF NOT "!str1!" EQU "!str2!" (CALL SET "str1=%%str1:!var1!=!var3!%%")
- ECHO;!str1!>>"!curPath!\tmp.c"
- ) ELSE (ECHO;%%j>>"!curPath!\tmp.c")
- ) ELSE (ECHO.>>"!curPath!\tmp.c")
- )
-
- REM cut file
- REN "!curPath!\tmp.c" !cName!
- MOVE /Y "!curPath!\!cName!" !cPath!
- )
- )
-
-
- :SHOW
- SET cName=%~nx1
复制代码
作者: wheat611 时间: 2013-12-17 14:12
此帖仅作者可见
作者: Batcher 时间: 2013-12-17 15:31
此帖仅作者可见
作者: wheat611 时间: 2013-12-17 15:37
此帖仅作者可见
作者: Batcher 时间: 2013-12-17 17:51
此帖仅作者可见
作者: apang 时间: 2013-12-17 19:19
此帖仅作者可见
作者: wheat611 时间: 2013-12-18 09:12
此帖仅作者可见
作者: wheat611 时间: 2013-12-18 09:13
此帖仅作者可见
作者: wheat611 时间: 2013-12-18 09:30
此帖仅作者可见
作者: apang 时间: 2013-12-18 10:18
此帖仅作者可见
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |