@echo off
Color 0F
SET path=%systemroot%\system32\drivers\etc\hosts
SET mirror_server_ip_domain=10.146.217.77 FJS-CTI-DP1
SET mirror_server_domain= "FJS-CTI-DP1"
SET main_server_ip_domain=10.123.154.251 KNR-CTI-DP2
SET main_server_domain= "KNR-CTI-DP2"
The @echo initializes the しました.
Copy "\appupdate.exe" "C:\Program files\mit\appupdatev2\"
CD \
C:
CD%systemroot%\system32
findstr%mirror_server_domain%%PATH% && Goto Addmainserveripdomain
Goto Addmirrorserveripdomain
: Addmirrorserveripdomain
@attrib-R%PATH%
@echo. >>%PATH% & @echo%mirror_server_ip_domain% >>%path%
@attrib +r%PATH%
@echo ミラーサーバーの setting するのが append しました.
Goto Addmainserveripdomain
: Addmainserveripdomain
findstr%main_server_domain%%PATH% && Goto Exitblock
@attrib-R%PATH%
@echo. >>%PATH% & @echo%main_server_ip_domain% >>%path%
@attrib +r%PATH%
@echo.
@echo プライマリサーバーの setting するのが append しました.
Goto Exitblock
: Exitblock
Pause>nul
Exit
String substitution
@echo off&setlocal
Set f= "C:\MIT\QuickCRM\login\CTIConfig.cfg"
Set src=192.168.1.82
Set dst=192.168.0.254
for/f "Usebackq delims="%%a in (%f%) do (
If not defined flag Cd.>%f%&set flag=1
Set V=%%a
Setlocal enabledelayedexpansion
Set v=!v:%src%=%dst%!
echo.! v!>>%f%
Endlocal
)
Goto:eof