作者oohay (五黑)
看板Programming
标题Re: .bat 档呼叫播音程式,
时间Thu Jan 24 19:51:20 2008
※ 引述《[email protected] (盛兴输入法)》之铭言:
: 我在 .bat 档呼叫播音程式,播一个音档 uoo3.wav
: 用的是 sndrec32.exe
: 可以播出声音,但无法结束,回到 .bat 的程序
: 既播完音会停在 播音程式画面,要用手动操作,
: 按档案,关闭,才会回到 .bat 批次档的下一个
: 动作.
: 我希望播完音,自动关闭播音程式,回到.bat的
: 下一个指令.
: 请问我该怎麽做,在.bat 内容如何写?
以Windows XP为例,
首先要把Task Scheduler服务打开,
然後写这样的批次档:
@echo off
if "%1" == "" goto help
start sndrec32.exe uoo3.wav
echo taskkill /fi "Imagename eq sndrec32.exe" > test3.bat
echo schtasks /delete /tn test3 /f >> test3.bat
schtasks /create /tn test3 /tr c:\test3.bat /sc minute /mo %1 /ru
!!User_Account!! /rp !!Password!! > NUL
echo "Happy New Year!"
goto end
:help
echo Usage: %0% m
echo m - after m minutes sndrec32 will be closed
:end
@echo on
这个批次档必须给一个参数代表几分钟之後要把所启动的sndrec32.exe关掉,
於是,你要先知道每个wav大概拨放多少时间,如果拨30分钟就把m设定为31,
免得还没拨完就关掉.
若要较精确的秒数,就再研究看看.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.231.17.237