- @echo off & setlocal enabledelayedexpansion
- set ListenPort=0
- set IsSupport=0
- goto dealmanager1
- set EableCall=1
- set EableOneMoreCall=1
- set Eable60P=0
- goto dealmanager2
- set Conference_Module=Meeting
- goto dealmanager3
- :dealmanager1
- (for /f " delims=:" %%h in ('findstr /n "." "!SourcePath!\Config\CoreDefConfig.ini"') do (
- set "str=%%i"
- if "!str:ListenPort=!" neq "%%i" (
- echo ListenPort=!ListenPort!
- ) else if "!str:IsSupport=!" neq "%%i" (
- echo IsSupport=!IsSupport!
- ) else (
- echo,%%i
- )
- ))>"!SourcePath!\Config\2.ini"
- del "!SourcePath!\Config\CoreDefConfig.ini"
- rename "!SourcePath!\Config\2.ini" "CoreDefConfig.ini"
- :dealmanager2
- (for /f "tokens=1* delims=:" %%h in ('findstr /n "." "!SourcePath!\Config\I7DefConfig.ini"') do (
- set "str=%%i"
- if "!str:EableCall=!" neq "%%i" (
- echo EableCall=!EableCall!
- ) else if "!str:EableOneMoreCall=!" neq "%%i" (
- echo EableOneMoreCall=!EableOneMoreCall!
- ) else if "!str:Eable60P=!" neq "%%i" (
- echo Eable60P=!Eable60P!
- ) else (
- echo,%%i
- )
- ))>"!SourcePath!\Config\3.ini"
- del "!SourcePath!\Config\I7DefConfig.ini"
- rename "!SourcePath!\Config\3.ini" "I7DefConfig.ini"
-
- :dealmanager3
- (for /f "tokens=1* delims=:" %%h in ('findstr /n "." "!SourcePath!\Module.ini"') do (
- set "str=%%i"
- if "!str:Conference_Module=!" neq "%%i" (
- echo Conference_Module=!Conference_Module!
- ) else (
- echo,%%i
- )
- ))>"!SourcePath!\4.ini"
- del "!SourcePath!\Module.ini"
- rename "!SourcePath!\4.ini" "Module.ini"
-
- pause
复制代码 替换文本内容,只有第一个dealmanager1修改成功,第二个dealmanager2修改失败,等号后面没有值,为空。第三个deal也有问题,很奇怪。 |