[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

批处理下如何使用wmplayer.exe参数

我想做一个自动播放系统,到时间自动播放音乐,播完后自动关机
我已经做好了AT自动定时,但如何一次播放多首歌曲呢?如何播完后自动关闭软件?
哪位高手知道wmplayer.exe的参数使用方法?

代码如下
  1. @echo off
  2. rem 开启任务计划服务,删除所有任务
  3. (
  4. sc config schedule start= auto
  5. net start schedule
  6. del c:\windows\tasks\at*.job
  7. ) >nul 2>nul
  8. set day15=Monday,Tuesday,Wednesday,Thursday,Friday
  9. set day3=Wednesday
  10. set day6=Saturday
  11. set day1245=Monday,Tuesday,Wednesday,Thursday,Friday
  12. set "铃声路径=E:\学校必备日常用曲\自动升级打铃音乐\"
  13. set "到校1=%铃声路径%012让我们荡起双桨.mp3"
  14. set "到校2=%铃声路径%51校园的早晨.mp3"
  15. set "上课=%铃声路径%001上课.mp3"
  16. set "下课=%铃声路径%002下课.mp3"
  17. set "课间提示=%铃声路径%007课间提示.mp3"
  18. set "放学=%铃声路径%005放学.mp3"
  19. set "放学安全提示=%铃声路径%006放学安全提示.mp3"
  20. set "眼保健操=%铃声路径%004眼保健操.mp3
  21. set "run=start wmplayer.exe "
  22. ::周一~周五上午
  23. at 7:40 /every:%day15% %run%%到校1%
  24. at 7:55 /every:%day15% %run%%到校2%
  25. at 8:10 /every:%day15% %run%%上课%
  26. at 8:20 /every:%day15% %run%%下课%
  27. at 8:24 /every:%day15% %run%%课间提示%
  28. at 8:30 /every:%day15% %run%%上课%
  29. at 9:10 /every:%day15% %run%%下课%
  30. at 8:14 /every:%day15% %run%%课间提示%
  31. at 9:20 /every:%day15% %run%%上课%
  32. at 10:00 /every:%day15% %run%%下课%
  33. at 10:30 /every:%day15% %run%%上课%
  34. at 11:10 /every:%day15% %run%%下课%
  35. at 11:12 /every:%day15% %run%%放学安全提示%
  36. ::周一二四五下午
  37. at 14:05 /every:%day15% %run%%到校1%
  38. at 14:10 /every:%day1245% %run%%上课%
  39. at 14:30 /every:%day1245% %run%%下课%
  40. at 14:34 /every:%day1245% %run%%课间提示%
  41. at 14:40 /every:%day1245% %run%%上课%
  42. at 15:20 /every:%day1245% %run%%眼保健操%
  43. at 15:30 /every:%day1245% %run%%课间提示%
  44. at 15:35 /every:%day1245% %run%%上课%
  45. at 16:15 /every:%day1245% %run%%下课%
  46. at 16:20 /every:%day1245% %run%%课间提示%
  47. at 16:25 /every:%day1245% %run%%上课%
  48. at 17:05 /every:%day1245% %run%%下课%
  49. at 17:07 /every:%day1245% %run%%放学安全提示%
  50. ::周三下午
  51. at 14:10 /every:%day3% %run%%上课%
  52. at 14:50 /every:%day3% %run%%下课%
  53. at 14:54 /every:%day3% %run%%课间提示%
  54. at 15:05 /every:%day3% %run%%上课%
  55. at 15:55 /every:%day3% %run%%下课%
  56. ::自动关机
  57. at 17:55 /every:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday shutdown -f -s -t 300 -c "下班回家啦,别累着了!如果您还想继续工作请使用桌面上的取消关机软件!"
  58. pause
复制代码
通用简洁实用就是批处理精神

一次播放多首,好像只能手动添加吧
自动关闭可以通过 taskkill来结束

TOP

本帖最后由 fastslz 于 2011-9-1 14:31 编辑
  1. @echo off
  2. if not exist vbPlay.vbs (
  3. >vbPlay.vbs  echo Set Args=WScript.Arguments
  4. >>vbPlay.vbs echo For i=0 to Args.Count-1
  5. >>vbPlay.vbs echo Dim Wmp:Set Wmp=CreateObject^("WMPlayer.OCX"^):Wmp.Settings.Volume="100":Wmp.Url=Args^(i^)
  6. >>vbPlay.vbs echo While Wmp.PlayState=9 or Wmp.PlayState=6 or Wmp.PlayState=3:WScript.Sleep 1000:Wend:Set Wmp=Nothing
  7. >>vbPlay.vbs echo Next
  8. )
  9. rem 开启任务计划服务,删除所有任务
  10. (
  11. sc config schedule start= auto
  12. net start schedule
  13. del c:\windows\tasks\at*.job
  14. ) >nul 2>nul
  15. set day15=Monday,Tuesday,Wednesday,Thursday,Friday
  16. set day3=Wednesday
  17. set day6=Saturday
  18. set day1245=Monday,Tuesday,Wednesday,Thursday,Friday
  19. set "铃声路径=E:\学校必备日常用曲\自动升级打铃音乐\"
  20. set "到校1=%铃声路径%012让我们荡起双桨.mp3"
  21. set "到校2=%铃声路径%51校园的早晨.mp3"
  22. set "上课=%铃声路径%001上课.mp3"
  23. set "下课=%铃声路径%002下课.mp3"
  24. set "课间提示=%铃声路径%007课间提示.mp3"
  25. set "放学=%铃声路径%005放学.mp3"
  26. set "放学安全提示=%铃声路径%006放学安全提示.mp3"
  27. set "眼保健操=%铃声路径%004眼保健操.mp3
  28. set "run=%~dp0vbPlay.vbs"
  29. ::周一~周五上午
  30. at 7:40 /every:%day15% "%run%" "%到校1%"
  31. at 7:55 /every:%day15% "%run%" "%到校2%"
  32. at 8:10 /every:%day15% "%run%" "%上课%"
  33. at 8:20 /every:%day15% "%run%" "%下课%"
  34. at 8:24 /every:%day15% "%run%" "%课间提示%"
  35. at 8:30 /every:%day15% "%run%" "%上课%"
  36. at 9:10 /every:%day15% "%run%" "%下课%"
  37. at 8:14 /every:%day15% "%run%" "%课间提示%"
  38. at 9:20 /every:%day15% "%run%" "%上课%"
  39. at 10:00 /every:%day15% "%run%" "%下课%"
  40. at 10:30 /every:%day15% "%run%" "%上课%"
  41. at 11:10 /every:%day15% "%run%" "%下课%"
  42. at 11:12 /every:%day15% "%run%" "%放学安全提示%"
  43. ::周一二四五下午
  44. at 14:05 /every:%day15% "%run%" "%到校1%"
  45. at 14:10 /every:%day1245% "%run%" "%上课%"
  46. at 14:30 /every:%day1245% "%run%" "%下课%"
  47. at 14:34 /every:%day1245% "%run%" "%课间提示%"
  48. at 14:40 /every:%day1245% "%run%" "%上课%"
  49. at 15:20 /every:%day1245% "%run%" "%眼保健操%"
  50. at 15:30 /every:%day1245% "%run%" "%课间提示%"
  51. at 15:35 /every:%day1245% "%run%" "%上课%"
  52. at 16:15 /every:%day1245% "%run%" "%下课%"
  53. at 16:20 /every:%day1245% "%run%" "%课间提示%"
  54. at 16:25 /every:%day1245% "%run%" "%上课%"
  55. at 17:05 /every:%day1245% "%run%" "%下课%"
  56. at 17:07 /every:%day1245% "%run%" "%放学安全提示%"
  57. ::周三下午
  58. at 14:10 /every:%day3% "%run%" "%上课%"
  59. at 14:50 /every:%day3% "%run%" "%下课%'
  60. at 14:54 /every:%day3% "%run%" "%课间提示%"
  61. at 15:05 /every:%day3% "%run%" "%上课%"
  62. at 15:55 /every:%day3% "%run%" "%下课%"
  63. ::自动关机
  64. at 17:55 /every:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday shutdown -f -s -t 300 -c "下班回家啦,别累着了!如果您还想继续工作请使用桌面上的取消关机软件!"
  65. pause
复制代码
连续播放2个或多个
  1. vbPlay.vbs "C:\花好.mp3" "D:\月圆.mp3"
复制代码
1

评分人数

TOP

谢谢,VB我一点都不懂呵,看来要好好学一学

再问一个:为什么我开启了服务有的电脑还是无法执行计划,而手动计划会问个用户密码就可以执行,是怎么回事
通用简洁实用就是批处理精神

TOP

回复 4# lfoqtal

要看运行环境的,账户类型
原因估计是密码账户

TOP

返回列表