- @echo off
- if exist "C:\Users\%username%\AppData\Roaming\Microsoft\FSX\dll.xml" (
- set "file=C:\Users\%username%\AppData\Roaming\Microsoft\FSX\dll.xml"
- ) else if exist "C:\Documents and Settings\%username%\Application Data\Microsoft\FSX\dll.xml" (
- set "file=C:\Documents and Settings\%username%\Application Data\Microsoft\FSX\dll.xml"
- ) else (
- echo 找不到文件 dll.xml
- pause
- exit
- )
- (for /f "usebackq delims=" %%i in ("%file%") do (
- set "str=%%i"
- setlocal enabledelayedexpansion
- if "!str: =!" == "</SimBase.Document>" (
- echo ^<Launch.Addon^>
- echo ^<Name^>FSCopilot^</Name^>
- echo ^<Disabled^>False^</Disabled^>
- echo ^<Path^>Modules\FSCopilot.dll^</Path^>
- echo ^</Launch.Addon^>
- )
- echo !str!
- endlocal
- ))>dll.xml.new
- move /y dll.xml.new dll.xml
复制代码
|