Can't open OBS

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
arkazal
Posts: 3
Joined: 19 Nov 2019, 17:49

Can't open OBS

Post by arkazal » 19 Nov 2019, 17:54

I have a script using a very simple run command.

Run, "C:\Program Files\obs-studio\bin\64bit\obs64.exe"

When I run this, I get an error telling me I don't have some locale file. If I personally navigate to that exact file by copying the path, pasting it into explorer and then run that EXE, I get no such error.

Why am I only getting the error when running with AHK? I'm running the exact same EXE file, so I can't believe it has to do with passing any sort of parameters, since I'm not using a shortcut link. I don't get errors when running any other EXE files either, it's only OBS.

Any ideas?
TAC109
Posts: 1111
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Can't open OBS

Post by TAC109 » 19 Nov 2019, 18:16

Provide the second parameter to the 'run' command as the path to (but not including) your executable.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: Can't open OBS

Post by gregster » 19 Nov 2019, 18:21

Welcome to te forum!

Basically, what TAC109 said.

The shortcut that OBS creates, specifies a working directory... and if you start the exe directly from its own directory in file explorer, it will find - and use - this same directory by default, but an AHK script's run command will use the script's own working directory, if you omit the corresponding parameter. Hence, use this:

Code: Select all

Run, "C:\Program Files\obs-studio\bin\64bit\obs64.exe" , C:\Program Files\obs-studio\bin\64bit
Also, don't use quotation marks in this parameter:
https://www.autohotkey.com/docs/commands/Run.htm#Parameters wrote:WorkingDir
The working directory for the launched item. Do not enclose the name in double quotes even if it contains spaces. If omitted, the script's own working directory (A_WorkingDir) will be used.
arkazal
Posts: 3
Joined: 19 Nov 2019, 17:49

Re: Can't open OBS

Post by arkazal » 20 Nov 2019, 01:30

Ah, wow, never knew about this. I did exactly as written here and it worked flawlessly. Thanks so much, you guys and gals are the best :thumbup:
superhappyfuntime
Posts: 1
Joined: 21 Dec 2019, 20:45

Re: Can't open OBS

Post by superhappyfuntime » 21 Dec 2019, 20:59

gregster wrote: Do not enclose the name in double quotes in the parameter.

Code: Select all

Run, "C:\Program Files\obs-studio\bin\64bit\obs64.exe" , C:\Program Files\obs-studio\bin\64bit
I created an account just to thank you for this post. :bravo:

Force of habit to use the double quotes on everything and had no idea it would override the working directory. Thank you!
llinfeng
Posts: 86
Joined: 08 Dec 2016, 21:54
Contact:

Re: Can't open OBS

Post by llinfeng » 22 Sep 2021, 08:46

It helps to know that working directories ought to be specified without quote. Just to add that, one can feed the numerous OBS launch parameters as well. Here is one example:

Code: Select all

Run, "C:\Program Files\obs-studio\bin\64bit\obs64.exe" --profile "StudyCam" --collection "LL" --scene "Zoom-MainCam" --startvirtualcam, C:\Program Files\obs-studio\bin\64bit
I use different profiles in OBS to specify the video output format, and use different scenes to stream, say, screen-captures or webcam-captures.
Post Reply

Return to “Ask for Help (v1)”