这个是保存成BAT文件运行的, 和cmd中运行的主要区别是变量要用两个百分号%%访问,cmd中是一个%
1.mod创建绝对路径资源.bat
REM 需管理员权限运行!
REM 下面的是命令把TA目录中的TA资源文件和3.92补丁的资源建立一个快捷方式到Mod目录
REM 建议使用相对路径的版本. 复制和移动目录后仍能正常运行.
set TAlocation="E:\Total_Annihilation"
set Modlocation="E:\Total_Annihilation"
for /f %%f in ('dir /b %TAlocation%\*.ccx') do mklink "%Modlocation%\%%f" "%TAlocation%\%%f"
for /f %%f in ('dir /b %TAlocation%\*.gp3') do mklink "%Modlocation%\%%f" "%TAlocation%\%%f"
for /f %%f in ('dir /b %TAlocation%\*.hpi') do mklink "%Modlocation%\%%f" "%TAlocation%\%%f"
for /f %%f in ('dir /b %TAlocation%\*.dll') do mklink "%Modlocation%\%%f" "%TAlocation%\%%f"
for /f %%f in ('dir /b %TAlocation%\*.ini') do copy /Y "%TAlocation%\%%f" "%Modlocation%\%%f"
mklink /D "%Modlocation%\music" "%TAlocation%\music"
mklink /D "%Modlocation%\Data" "%TAlocation%\Data"
mklink /D "%Modlocation%\Shaders" "%TAlocation%\Shaders"
mkdir "%Modlocation%\Icon"
copy /Y "%TAlocation%\Icon" "%Modlocation%\Icon"
- 2.mod创建相对路径资源, 在命令行窗口内运行d
REM 首先保证Mod所在目录是在TA主目录的里面.
REM 打开管理员命令行窗口Cmd.
REM 切换到Mod所在目录, 复制下面的命令到命令行窗口, 回车运行.
for /f %f in ('dir /b ..\*.ccx') do mklink ".\%f" "..\%f"
for /f %f in ('dir /b ..\*.gp3') do mklink ".\%f" "..\%f"
for /f %f in ('dir /b ..\*.hpi') do mklink ".\%f" "..\%f"
for /f %f in ('dir /b ..\*.dll') do mklink ".\%f" "..\%f"
for /f %f in ('dir /b ..\*.ini') do copy /Y "..\%f" ".\%f"
REM 建立UFO类文件的快捷方式前, 必须把里面含的是单位的ufo除外.会搞乱MOD的单位ID
for /f %f in ('dir /b ..\*.ufo') do mklink ".\%f" "..\%f"
mklink /D .\music ..\music
mklink /D .\Data ..\Data
mklink /D .\Shaders ..\Shaders
mkdir Icon
copy /Y ..\Icon .\Icon