您的位置:首页 > 其它

Windows下打开多个console程序,同时指定其窗口位置的批处理方法

2013-05-08 14:58 555 查看
示例:

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐