我想打开一个软件,即OBS(开放广播软件)使用批处理文件,然后自动开始录音,不受我的干扰。我为录制设置的热键是pgup,但我不想按它,我希望批处理文件自动发送信号,即按下pgup键并开始录制。如何使用批处理文件进行此操作?
这是我用来启动它的代码。
@ECHO OFF
start /d "D:\OBS Studio\obs-studio\bin\64bit" obs64.exe谢谢。
发布于 2017-05-26 14:34:58
当您可以使用跑直接从AHK内部启动它时,您为什么要通过cmd来传递它?
; Checks to see if you're running the script as admin
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
; The key you use to start/stop recording
startRec := "PGUP"
; Path to your OBS exe
obsPath := "C:\Program Files (x86)\obs-studio\bin\64bit\obs64.exe"
; Splits path up int dir and file name.
SplitPath, obsPath, obsFileName, obsDir
; Closes any previously opened OBS instances
while WinExist("ahk_exe " obsFileName)
WinClose, % "ahk_exe " obsFileName
; Run OBS
Run, % obsPath, % obsDir
; Waits until the OBS window has come up
while !WinExist("ahk_exe " obsFileName)
Sleep, 1000
; Minimized OBS
WinMinimize, % "ahk_exe " obsFileName
Sleep, 1000
; Sends key to program to start recording
ControlSend, % "Qt5QWindowIcon2", {%startRec%}, % "ahk_exe " obsFileName
; Run your game here.
ExitApphttps://stackoverflow.com/questions/44201817
复制相似问题