呆唯的小号吧 关注:3贴子:57
  • 6回复贴,共1

【原创】批处理整点报时程序

只看楼主收藏回复

一楼祈福


IP属地:四川1楼2014-02-08 19:42回复
    不隐藏窗口无弹窗版,
    ------------------分割线----下面是文件内容,文本保存为bat文件--------------------------
    @echo off
    title 整点报时
    color b
    mode con: cols=42 lines=20
    echo. ========================================
    echo. 说明
    echo. ========================================
    echo. ----------------------------------------
    echo. 1.报时音源来自系统中文语音包,若无报时语音,可能是中文语音包缺失。
    echo.
    echo. 2.本程序在整点时会出现弹窗,如果不希望弹窗,请自行编辑本程序的倒数第6行。
    echo. ----------------------------------------
    echo.
    echo. 按任意键开始运行。。。
    pause>nul
    echo. 报时娘工作中。。。
    echo wscript.sleep 500>"%temp%\~delayala.vbs"
    :str
    set /a h=%TIME:~0,2%
    if %time:~3,2%==59 goto cht
    if not %time:~3,2%==59 goto dely
    :cht
    if not %TIME:~0,2%==%h% goto ala
    if %TIME:~0,2%==%h% "%temp%\~delayala.vbs"
    goto cht
    :dely
    set /a t=(59-%time:~3,2%)*60000-4000
    echo wscript.sleep %t%>"%temp%\~delayala.vbs"
    "%temp%\~delayala.vbs"
    echo wscript.sleep 500>"%temp%\~delayala.vbs"
    goto cht
    :ala
    ::start 报时弹窗.bat ::如果不希望弹窗,请在此行前输入::(英文格式)
    set msg=卧槽,都%TIME:~0,2%点了!
    mshta vbscript:createobject("sapi.spvoice").speak("%msg%")(window.close)
    echo wscript.sleep 45000>"%temp%\~delayala.vbs"
    "%temp%\~delayala.vbs"
    goto str


    IP属地:四川4楼2014-02-08 23:22
    收起回复
      隐藏窗口无弹窗版
      ------------------分割线----下面是文件内容,文本保存为bat文件--------------------------
      @echo off
      title 整点报时
      color b
      mode con: cols=42 lines=20
      echo. ========================================
      echo. 报时娘说明
      echo. ========================================
      echo. ----------------------------------------
      echo. 1.报时娘很羞涩,10秒后就会隐身工作哦~让她休息就在进程里关掉cmd.exe好啦!
      echo.
      echo. 2.有系统中文语音包人家才会说话哦~
      echo.
      echo. 3.整点报时娘会弹窗叫你,如果不希望弹窗,请调教她的倒数第6行。
      echo. ----------------------------------------
      echo.
      echo. 趁现在看看我吧,马上就没机会咯(o゜ω゜o)
      echo wscript.sleep 10000>"%temp%\~delayala.vbs"
      "%temp%\~delayala.vbs"
      echo. 报时娘工作中。。。
      if not "%1"=="wind" mshta vbscript:createobject("wscript.shell").run("""%~f0"" wind",vbhide)(window.close)&&exit ::隐藏窗口
      echo wscript.sleep 500>"%temp%\~delayala.vbs"
      :str
      set /a h=%TIME:~0,2%
      if %time:~3,2%==59 goto cht
      if not %time:~3,2%==59 goto dely
      :cht
      if not %TIME:~0,2%==%h% goto ala
      if %TIME:~0,2%==%h% "%temp%\~delayala.vbs"
      goto cht
      :dely
      set /a t=(59-%time:~3,2%)*60000-4000
      echo wscript.sleep %t%>"%temp%\~delayala.vbs"
      "%temp%\~delayala.vbs"
      echo wscript.sleep 500>"%temp%\~delayala.vbs"
      goto cht
      :ala
      ::start 报时弹窗.bat ::如果不希望弹窗,请在此行前输入::(英文格式)
      set msg=卧槽,都%TIME:~0,2%点了!
      mshta vbscript:createobject("sapi.spvoice").speak("%msg%")(window.close)
      echo wscript.sleep 45000>"%temp%\~delayala.vbs"
      "%temp%\~delayala.vbs"
      goto str


      IP属地:四川6楼2014-02-08 23:24
      收起回复
        若需要弹窗,请去掉上面两个文件倒数第六行最前面的::
        然后将下面的代码复制,并命名为“报时弹窗.bat”
        ------------------------将下面代码保存为--报时弹窗.bat----------------
        @echo off
        if not "%1"=="wind" mshta vbscript:createobject("wscript.shell").run("""%~f0"" wind",vbhide)(window.close)&&exit ::隐藏窗口
        mshta vbscript:msgbox("卧槽,都%TIME:~0,2%点了!",64,"batch script")(window.close)


        IP属地:四川7楼2014-02-08 23:27
        收起回复