China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-29 09:02
中国DOS联盟论坛 » 论坛回收站 » Asking for help from experts, I know nothing about batch processing, thank you View 1,904 Replies 1
Original Poster Posted 2010-11-15 14:04 ·  中国 四川 乐山 电信
新手上路
Credits 5
Posts 7
Joined 2010-11-14 18:40
15-year member
UID 177532
Gender Male
Status Offline
I am an Internet café user. I request a master to make a batch processing. The requirement is to run 1.EXE in the time period from 0 - 4 o'clock and forcefully modify the homepage to http://www.baidu.com, run 2.exe in 4 - 8 o'clock and forcefully modify the homepage to http://www.sogou.com, run 3.EXE in the time period from 8 - 12 o'clock and forcefully modify the homepage to http://www.google.com.hk, run 4.EXE in the time period from 12 - 16 o'clock and forcefully modify the homepage to http://www.youdao.com, run 5.EXE in the time period from 16 - 20 o'clock and forcefully modify the homepage to http://www.yahoo.cn, and run 6.EXE in the time period from 16 - 20 o'clock and forcefully modify the homepage to http://www.soso.com/. Before this batch processing, please run a batch processing code (ARP binding)
@echo OFF
arp -d
if %~n0==arp exit
if %~n0==Arp exit
if %~n0==ARP exit
echo 正在获取本机信息.....
:IP
FOR /f "skip=13 tokens=15 usebackq " %%i in (`ipconfig /all`) do Set IP=%%i && GOTO MAC
:MAC
echo IP:%IP%
FOR /f "skip=13 tokens=12 usebackq " %%i in (`ipconfig /all`) do Set MAC=%%i && GOTO GateIP
:GateIP
echo MAC:%MAC%
arp -s %IP% %MAC%
echo 正在获取网关信息.....
FOR /f "skip=17 tokens=13 usebackq " %%i in (`ipconfig /all`) do Set GateIP=%%i && GOTO GateMac
:GateMac
echo GateIP:%GateIP%
ping %GateIP% -t -n 1
FOR /f "skip=3 tokens=2 usebackq " %%i in (`arp -a %GateIP%`) do Set GateMAC=%%i && GOTO Start
:Start
echo GateMAC:%GateMAC%
arp -s %GateIP% %GateMac%
exit
Need to merge 2 batch processings. Thanks~! I am completely ignorant of BAT production. Please help. Thanks

[ Last edited by samgege on 2010-11-15 at 18:43 ]
Floor 2 Posted 2010-11-15 18:43 ·  中国 四川 乐山 电信
新手上路
Credits 5
Posts 7
Joined 2010-11-14 18:40
15-year member
UID 177532
Gender Male
Status Offline
Forum Jump: