使用重定向操作,屏蔽标准输出为>nul,屏蔽错误输出为 2>nul- @echo off
- echo.strSoundFile = "%SystemRoot%\Media\Windows XP 注销音.wav">hanye.vbs
- echo.Set objShell = CreateObject("Wscript.Shell")>>hanye.vbs
- echo.strCommand = "sndrec32 /play /close " ^& chr(34) ^& strSoundFile ^& chr(34)>>hanye.vbs
- echo.objShell.Run strCommand, 0, True>>hanye.vbs
- :s
- ping -n 6 127.1 >nul 2>nul
- ping -n 1 192.168.1.1 >nul 2>nul||cscript //nologo hanye.vbs
- goto:s
复制代码 或:- @echo off
- :s
- ping -n 6 127.1 >nul 2>nul
- ping -n 1 192.168.1.1 >nul 2>nul||start "" "%ProgramFiles%\Ringz Studio\Storm Codec\mplayerc.exe" /play /close /minimized "G:\Documents\My Music\What Becomes Of Us.mp3"
- goto:s
复制代码 其中%ProgramFiles%\Ringz Studio\Storm Codec\mplayerc.exe为暴风影音
[ 本帖最后由 hanyeguxing 于 2010-5-14 19:06 编辑 ] |