我有个批处理,在需要修改的文件的根目录下是可以运行的,放到其他盘就运行后无效了,要怎么弄?求助大神帮忙解答
比如,我放公共盘运行,批处理就无效,麻烦帮忙看看- @echo off & setlocal enabledelayedexpansion
-
- set text1=C:\EragonSystem--M505\CommonSetting\CommonSetting1.xml
-
-
-
- set text2=C:\EragonSystem--M505\CommonSetting\CommonSetting1.xml
-
-
- set var1=ABC
- set var2=1.39.0
- set var3=FACTORY_HMI_M505_A03_dandelion_q0.mp1.tc8sp3-V1.4_T525_0804
- set var4=32GB
- set var5=2GB
-
- set var6=UW
- set var7=2.19.0
- set var8=FACTORY_HMI_M505_A03_dandelion_q0.mp1.tc8sp3-V1.4_T530_0318
- set var9=64GB
- set var10=4GB
-
-
- echo %var1%
-
- echo %var2%
-
- echo %var3%
-
- echo %var4%
-
- echo %var5%
-
- echo %var6%
-
- echo %var7%
-
- echo %var8%
-
- echo %var9%
-
- echo %var10%
-
-
-
- for /f "delims=*" %%i in (%text1%) do (
- if "%%i"=="" (echo.) else (set "line=%%i" & call :chg)
-
- )>>%text2%
-
- del %text1%
-
- move %text2% %text1%
-
-
-
-
- exit
-
- :chg
-
- set "line=!line:%var1%=%var6%!"
-
- set "line=!line:%var2%=%var7%!"
-
- set "line=!line:%var3%=%var8%!"
-
- set "line=!line:%var4%=%var9%!"
- set "line=!line:%var5%=%var10%!"
-
-
-
- echo !line!
-
- pause
- goto :eof
复制代码
|