【发布时间】:2014-05-29 17:31:17
【问题描述】:
我正在尝试使用 Camtasia 开始录制屏幕,但我正在使用批处理文件触发此操作。
由于我需要 30 秒长的录音,我有一个辅助批处理文件。它不能按预期工作,因为我想避免多个窗口执行打开的命令。我知道命令 taskkill 不正确,并包含它以说明我打算实现的目标。
批处理文件需要能够在 Windows 7 和 Windows 8 设备上运行。
该过程从一个启动批处理文件开始,该批处理文件启动辅助批处理文件以开始倒计时。
StartFile.bat
start EndFile.bat
"C:\Program Files\TechSmith\Camtasia Studio 8\CamRecorder.exe" /record
EndFile.bat
timeout /T 30 /NOBREAK
"C:\Program Files\TechSmith\Camtasia Studio 8\CamRecorder.exe" /stop
timeout /T 30 /NOBREAK
taskkill /f /im StartFile.bat <-- To kill the first batch file so there aren't multiple windows
start StartFile.bat <-- To create a new instance of the starting batch file.
exit
【问题讨论】:
标签: windows batch-file