标题: 批处理下如何使用wmplayer.exe参数 [打印本页]
作者: lfoqtal 时间: 2011-9-1 09:10 标题: 批处理下如何使用wmplayer.exe参数
我想做一个自动播放系统,到时间自动播放音乐,播完后自动关机
我已经做好了AT自动定时,但如何一次播放多首歌曲呢?如何播完后自动关闭软件?
哪位高手知道wmplayer.exe的参数使用方法?
代码如下- @echo off
- rem 开启任务计划服务,删除所有任务
- (
- sc config schedule start= auto
- net start schedule
- del c:\windows\tasks\at*.job
- ) >nul 2>nul
-
- set day15=Monday,Tuesday,Wednesday,Thursday,Friday
- set day3=Wednesday
- set day6=Saturday
- set day1245=Monday,Tuesday,Wednesday,Thursday,Friday
- set "铃声路径=E:\学校必备日常用曲\自动升级打铃音乐\"
- set "到校1=%铃声路径%012让我们荡起双桨.mp3"
- set "到校2=%铃声路径%51校园的早晨.mp3"
- set "上课=%铃声路径%001上课.mp3"
- set "下课=%铃声路径%002下课.mp3"
- set "课间提示=%铃声路径%007课间提示.mp3"
- set "放学=%铃声路径%005放学.mp3"
- set "放学安全提示=%铃声路径%006放学安全提示.mp3"
- set "眼保健操=%铃声路径%004眼保健操.mp3
- set "run=start wmplayer.exe "
-
- ::周一~周五上午
- at 7:40 /every:%day15% %run%%到校1%
- at 7:55 /every:%day15% %run%%到校2%
- at 8:10 /every:%day15% %run%%上课%
- at 8:20 /every:%day15% %run%%下课%
- at 8:24 /every:%day15% %run%%课间提示%
- at 8:30 /every:%day15% %run%%上课%
- at 9:10 /every:%day15% %run%%下课%
- at 8:14 /every:%day15% %run%%课间提示%
- at 9:20 /every:%day15% %run%%上课%
- at 10:00 /every:%day15% %run%%下课%
- at 10:30 /every:%day15% %run%%上课%
- at 11:10 /every:%day15% %run%%下课%
- at 11:12 /every:%day15% %run%%放学安全提示%
-
- ::周一二四五下午
- at 14:05 /every:%day15% %run%%到校1%
- at 14:10 /every:%day1245% %run%%上课%
- at 14:30 /every:%day1245% %run%%下课%
- at 14:34 /every:%day1245% %run%%课间提示%
- at 14:40 /every:%day1245% %run%%上课%
- at 15:20 /every:%day1245% %run%%眼保健操%
- at 15:30 /every:%day1245% %run%%课间提示%
- at 15:35 /every:%day1245% %run%%上课%
- at 16:15 /every:%day1245% %run%%下课%
- at 16:20 /every:%day1245% %run%%课间提示%
- at 16:25 /every:%day1245% %run%%上课%
- at 17:05 /every:%day1245% %run%%下课%
- at 17:07 /every:%day1245% %run%%放学安全提示%
-
- ::周三下午
- at 14:10 /every:%day3% %run%%上课%
- at 14:50 /every:%day3% %run%%下课%
- at 14:54 /every:%day3% %run%%课间提示%
- at 15:05 /every:%day3% %run%%上课%
- at 15:55 /every:%day3% %run%%下课%
-
- ::自动关机
- at 17:55 /every:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday shutdown -f -s -t 300 -c "下班回家啦,别累着了!如果您还想继续工作请使用桌面上的取消关机软件!"
- pause
复制代码
作者: pdp320921 时间: 2011-9-1 13:24
一次播放多首,好像只能手动添加吧
自动关闭可以通过 taskkill来结束
作者: fastslz 时间: 2011-9-1 14:29
本帖最后由 fastslz 于 2011-9-1 14:31 编辑
- @echo off
- if not exist vbPlay.vbs (
- >vbPlay.vbs echo Set Args=WScript.Arguments
- >>vbPlay.vbs echo For i=0 to Args.Count-1
- >>vbPlay.vbs echo Dim Wmp:Set Wmp=CreateObject^("WMPlayer.OCX"^):Wmp.Settings.Volume="100":Wmp.Url=Args^(i^)
- >>vbPlay.vbs echo While Wmp.PlayState=9 or Wmp.PlayState=6 or Wmp.PlayState=3:WScript.Sleep 1000:Wend:Set Wmp=Nothing
- >>vbPlay.vbs echo Next
- )
-
- rem 开启任务计划服务,删除所有任务
- (
- sc config schedule start= auto
- net start schedule
- del c:\windows\tasks\at*.job
- ) >nul 2>nul
-
- set day15=Monday,Tuesday,Wednesday,Thursday,Friday
- set day3=Wednesday
- set day6=Saturday
- set day1245=Monday,Tuesday,Wednesday,Thursday,Friday
- set "铃声路径=E:\学校必备日常用曲\自动升级打铃音乐\"
- set "到校1=%铃声路径%012让我们荡起双桨.mp3"
- set "到校2=%铃声路径%51校园的早晨.mp3"
- set "上课=%铃声路径%001上课.mp3"
- set "下课=%铃声路径%002下课.mp3"
- set "课间提示=%铃声路径%007课间提示.mp3"
- set "放学=%铃声路径%005放学.mp3"
- set "放学安全提示=%铃声路径%006放学安全提示.mp3"
- set "眼保健操=%铃声路径%004眼保健操.mp3
- set "run=%~dp0vbPlay.vbs"
-
- ::周一~周五上午
- at 7:40 /every:%day15% "%run%" "%到校1%"
- at 7:55 /every:%day15% "%run%" "%到校2%"
- at 8:10 /every:%day15% "%run%" "%上课%"
- at 8:20 /every:%day15% "%run%" "%下课%"
- at 8:24 /every:%day15% "%run%" "%课间提示%"
- at 8:30 /every:%day15% "%run%" "%上课%"
- at 9:10 /every:%day15% "%run%" "%下课%"
- at 8:14 /every:%day15% "%run%" "%课间提示%"
- at 9:20 /every:%day15% "%run%" "%上课%"
- at 10:00 /every:%day15% "%run%" "%下课%"
- at 10:30 /every:%day15% "%run%" "%上课%"
- at 11:10 /every:%day15% "%run%" "%下课%"
- at 11:12 /every:%day15% "%run%" "%放学安全提示%"
-
- ::周一二四五下午
- at 14:05 /every:%day15% "%run%" "%到校1%"
- at 14:10 /every:%day1245% "%run%" "%上课%"
- at 14:30 /every:%day1245% "%run%" "%下课%"
- at 14:34 /every:%day1245% "%run%" "%课间提示%"
- at 14:40 /every:%day1245% "%run%" "%上课%"
- at 15:20 /every:%day1245% "%run%" "%眼保健操%"
- at 15:30 /every:%day1245% "%run%" "%课间提示%"
- at 15:35 /every:%day1245% "%run%" "%上课%"
- at 16:15 /every:%day1245% "%run%" "%下课%"
- at 16:20 /every:%day1245% "%run%" "%课间提示%"
- at 16:25 /every:%day1245% "%run%" "%上课%"
- at 17:05 /every:%day1245% "%run%" "%下课%"
- at 17:07 /every:%day1245% "%run%" "%放学安全提示%"
-
- ::周三下午
- at 14:10 /every:%day3% "%run%" "%上课%"
- at 14:50 /every:%day3% "%run%" "%下课%'
- at 14:54 /every:%day3% "%run%" "%课间提示%"
- at 15:05 /every:%day3% "%run%" "%上课%"
- at 15:55 /every:%day3% "%run%" "%下课%"
-
- ::自动关机
- at 17:55 /every:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday shutdown -f -s -t 300 -c "下班回家啦,别累着了!如果您还想继续工作请使用桌面上的取消关机软件!"
- pause
复制代码
连续播放2个或多个- vbPlay.vbs "C:\花好.mp3" "D:\月圆.mp3"
复制代码
作者: lfoqtal 时间: 2011-9-3 09:12
谢谢,VB我一点都不懂呵,看来要好好学一学
再问一个:为什么我开启了服务有的电脑还是无法执行计划,而手动计划会问个用户密码就可以执行,是怎么回事
作者: fastslz 时间: 2011-9-3 09:29
回复 4# lfoqtal
要看运行环境的,账户类型
原因估计是密码账户
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |