示例:
E:
cd E:\Bin\Server1
reg add hkcu\Console /t REG_DWORD /v WindowPosition /d 0x0000 /f //1
start Server1.exe //2
@ping -n 3 127.1>nul //3
cd E:\Bin\Server2
reg add hkcu\Console /t REG_DWORD /v WindowPosition /d 0x029d /f
start Server2.exe
@ping -n 1 127.1>nul
cd E:\Bin\Server3
reg add hkcu\Console /t REG_DWORD /v WindowPosition /d 0x053a /f
start Server3.exe
@ping -n 1 127.1>nul
cd E:\Bin\Server4
reg add hkcu\Console /t REG_DWORD /v WindowPosition /d 0x2600000 /f
start Server4.exe
@ping -n 1 127.1>nul
cd E:\Bin\Server5
reg add hkcu\Console /t REG_DWORD /v WindowPosition /d 0x260029d /f
start Server5.exe
@ping -n 1 127.1>nul
cd E:\Bin\Server6
reg add hkcu\Console /t REG_DWORD /v WindowPosition /d 0x260053a /f
start Server6.exe
@ping -n 1 127.1>nul
reg add hkcu\Console /t REG_DWORD /v WindowPosition /d 0x13f029d /f //4
exit //5
说明:
1、这个是在打开之前修改下console的窗口位置属性。“0x0000”标示了位置。其低四位是窗口x坐标,高四位是y坐标。屏幕左上角为坐标原点。
2、启动程序.
3、这行是用来暂停的,以便服务器有时间进行初始化。
4、这行用来调整批处理窗口位置,这样批处理窗口以后每次打开都是在一个位置。
5、退出。
taskkill /f /t /im Server1.exe
taskkill /f /t /im Server2.exe
taskkill /f /t /im Server3.exe
taskkill /f /t /im Server4.exe
taskkill /f /t /im Server5.exe
taskkill /f /t /im Server6.exe
先将本地服务器的配置文件copy出来,然后更新本地服务器文件,最后再将本地配置文件copy回去的批处理:
C:
cd C:\Users\Raynay Yue\Desktop
move /Y E:\Bin\Server1\Server1.ini
move /Y E:\Bin\Server2\configure.ini
move /Y E:\Bin\Server3\configure.ini pconfigure.ini //对重名的配置文件进行改名
move /Y E:\Bin\Server4\Server4.ini
move /Y E:\Bin\Server5\Server5.ini
move /Y E:\Bin\Server6\Server6.ini
rd /s /q E:\Bin
md E:\Bin
xcopy /e /y \\要更新的服务器文件所在地址\Bin\ E:\Bin\
move /Y Server1.ini E:\Bin\Server1
move /Y configure.ini E:\Bin\Server2
move /Y pconfigure.ini E:\Bin\Server3\configure.ini
move /Y Server4.ini E:\Bin\Server4
move /Y Server5.ini E:\Bin\Server5
move /Y Server6.ini E:\Bin\Server6
exit