Re: .bat 檔呼叫播音程式,

看板Programming作者 (五黑)時間18年前 (2008/01/24 19:51), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《dasnncku.bbs@bbs.ncku.edu.tw (盛興輸入法)》之銘言: : 我在 .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
文章代碼(AID): #17c7kvdI (Programming)
討論串 (同標題文章)
文章代碼(AID): #17c7kvdI (Programming)