STEAM GROUP
Big Picture bigpic
STEAM GROUP
Big Picture bigpic
1,093
IN-GAME
4,263
ONLINE
Founded
September 10, 2012
Author X Sep 12, 2012 @ 6:19pm
Automatic start-up with Big Picture, and close Steam with Big Picture using AutoHotKey
Hey all, I noticed that two of the most-requested features for Big Picture so far are being able to boot into Big Picture mode as soon as Steam starts, and to close Steam when Big Picture is closed (especially if it's launched from XBMC, for example).

I use AutoHotKey a lot for creating shortcuts and automating things on my computer, so I thought I'd throw together a script to launch and shut down Steam and Big Picture together. I'm sure those features are coming soon, since they're so highly-demanded, but if you install AutoHotKey ( http://www.autohotkey.com ), you can put this script into a text file, save it as something ending in .ahk, and use that as a shortcut to Big Picture mode. If you want Big Picture to start up as soon as the machine boots, just put that shortcut in your Startup folder in the start menu.

Process, Exist, Steam.exe if ErrorLevel Run, "steam://open/bigpicture" else Run, "D:\Program Files (x86)\Steam\Steam.exe" -bigpicture WinWait, Steam ahk_class CUIEngineWin32 WinWaitClose, Steam ahk_class CUIEngineWin32 Run, "D:\Program Files (x86)\Steam\Steam.exe" -shutdown

What it does is check whether the Steam.exe process is running, and then either use the URL protocol if it is, or open it with the -bigpicture option if it isn't (neither of those seem to work in all cases, so this check covers both). Then it waits for the Big Picture window to appear (the "ahk_class CUIEngineWin32" window), waits again for it to disappear, and finally force-closes Steam.

*edit*
It no longer force-closes Steam, thank you Voodooman for pointing out that the -shutdown option can be used instead.

Also be sure to change the location of Steam.exe to match your installation (like to the C: drive, for example, if that's where you have it installed)

Personally, I leave Steam running in the background all the time (and I launch XBMC from BP instead of the other way around), but I would like to be able to start BP without using the mouse. So I only used the first part of the code and bound it to the Back button on my controller (the #IfWinNotExist line will make sure it only runs when Big Picture is not already running, so that the Back key works normally once I'm in a game, and BP is still going in the background):

#IfWinNotExist, Steam ahk_class CUIEngineWin32 Joy7:: Process, Exist, Steam.exe if ErrorLevel Run, "steam://open/bigpicture" else Run, "D:\Program Files (x86)\Steam\Steam.exe" -bigpicture

It's a bit messy (especially force-closing Steam, which is known to cause issues with Offline Mode), but if you want to try setting it up through XBMC or as a HTPC front-end, you can use this script until the features are officially supported. You can also use AHK compile the script into a stand-alone exe and run it on a computer without AHK installed (I'd do it for you, but I don't trust exe's from random forum posts, and I don't want to encourage others do).

If you want it to shut down the computer once you exit Big Picture, replace the last line with:
Shutdown, 5
That will shutdown the computer, while forcing all applications to exit. I'm assuming you won't have applications with unsaved data floating around. If you want it to shut down more gently, and allow applications to warn you about unsaved data, use 1 as the code instead of 5.
Last edited by Author X; Sep 12, 2012 @ 7:34pm
< >
Showing 1-9 of 9 comments
Voodooman Sep 12, 2012 @ 7:27pm 
you can use steam.exe -shutdown for proper shutdown instead of killing process
Author X Sep 12, 2012 @ 7:28pm 
Ah, cool, I was looking for something like that but I couldn't find it in a list of options (clearly I wasn't looking hard enough). I'll edit that into the top post, thanks.

I also forgot to point out that the path to Steam.exe should, of course, be modified to your own Steam install path (mine is on the D drive, in this case)
Last edited by Author X; Sep 12, 2012 @ 7:29pm
PlayingKarrde Sep 12, 2012 @ 10:21pm 
Well you pretty much exactly nailed what I had planned on doing. Thanks you saved me a ton of time. I'm going to try and incorporate this with an UltraMon script so I can switch primary monitors during each part so that I can launch BPM on my TV with the back button.

Thanks again.
tritium. Sep 12, 2012 @ 11:24pm 
ATI also has built in hotkey support. I use alt+f6 to switch monitors
hakunamatatata Sep 14, 2012 @ 10:55pm 
Thanks Author X! I found this thread after you referenced it in the "Command Line Issue" thread. It's exactly what I needed.
Sylver Nov 11, 2012 @ 9:09am 
Thanks, that was usefull. Personaly I prefer using the combination of back and Start using this hot key: joy7 & joy8::
That way, there is no cofunsion if big picture must be started or not while playing a game since I don't know any game where you should press those buttons in the same time.

Edit: sorry you need to use :
joy8::
if not GetKeyState("Joy7")
return
Last edited by Sylver; Nov 11, 2012 @ 9:54am
Todd Aug 18, 2013 @ 11:01am 
Ok I am running Windows 8.1 preview with 2 monitors (one TV). I created a Frankenstein script that works for me from various sources I have found here and elsewhere:

#IfWinNotExist, Steam ahk_class CUIEngineWin32 joy8:: if not GetKeyState("Joy7") return RunWait, "C:\Windows\System32\DisplaySwitch.exe" /internal Process, Exist, Steam.exe if ErrorLevel Run, "steam://open/bigpicture" else Run, "E:\Games\Steam\Steam.exe" -bigpicture WinWait, Steam ahk_class CUIEngineWin32

I can quit BPM using the GUI in BPM thats no problem. But I need to figure out out to enact the following as soon as BPM is ended so I can return to extended monitors mode mode:

RunWait, "C:\Windows\System32\DisplaySwitch.exe" /extend

Anyone have any ideas?
Author X Aug 18, 2013 @ 11:14am 
That's what the WinWait lines were for in my original script. WinWait followed by WinWaitClose forces the script to wait until BPM is opened then closed again, and then resumes with the next line. So you can replace my "shutdown" line (that was before BPM let you shut down Steam completely from the GUI) with your DisplaySwitch command.
Todd Aug 18, 2013 @ 11:41am 
Absolute perfection. Thank you very much sir!

Final code:
#IfWinNotExist, Steam ahk_class CUIEngineWin32 joy8:: if not GetKeyState("Joy7") return RunWait, "C:\Windows\System32\DisplaySwitch.exe" /internal Process, Exist, Steam.exe if ErrorLevel Run, "steam://open/bigpicture" else Run, "E:\Games\Steam\Steam.exe" -bigpicture WinWait, Steam ahk_class CUIEngineWin32 WinWaitClose, Steam ahk_class CUIEngineWin32 RunWait, "C:\Windows\System32\DisplaySwitch.exe" /extend
< >
Showing 1-9 of 9 comments
Per page: 15 30 50

Date Posted: Sep 12, 2012 @ 6:19pm
Posts: 9