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

示例:

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


  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值