Windows Shutdown XBMC when starting games?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Torro14 Offline
Junior Member
Posts: 47
Joined: Aug 2011
Reputation: 0
Post: #1
I want to start my games in XBMC with Advanced Launcher. This works fine.
While playing games, XBMC runs in the background, is it possible to close XBMC when the game has started, and restart XBMC when i quit the game?

If not, is it possible to minimize XBMC to tray to save resources?
find quote
anthonymcdevitt Offline
Junior Member
Posts: 21
Joined: May 2012
Reputation: 0
Location: Michigan
Post: #2
I use something called pssuspend. It suspends the xbmc application until the game is closed. This does not already come with windows, so download..

http://technet.microsoft.com/en-us/sysin...s/bb897540

theres an instruction inside the archive, however basically just copy those files to ur windows folder. Now make batch file for your games, heres an example of mine for skyrim.

pssuspend XBMC.exe
cd "C:\Program Files (x86)\the elder scrolls v skyrim"
tesv.exe %1
pssuspend -r XBMC.exe

This does a great job ssaving resources as it stop xbmc completely but wakes right back upp as soon as you exit. However take note that xbmc will not wake until that game is closed. So if you try to alt tab to it or anything it will just say not responding
(This post was last modified: 2012-05-13 17:03 by anthonymcdevitt.)
find quote
Torro14 Offline
Junior Member
Posts: 47
Joined: Aug 2011
Reputation: 0
Post: #3
Thanks for your link.

I created a batch file for one of my games to test it, but its not working correctly.

The first to times it started the game, and after closing the game XBMC came back from sleep, but in small window, not fullscreen.
The next tries XBMC stays suspend, cause the game.exe is not really closed by leaving the game, this only happens when i call pssuspend in the batch-file........
find quote
Angelscry Offline
Skilled Python Coder
Posts: 2,686
Joined: Sep 2010
Reputation: 37
Location: MTL, Canada
Post: #4
XBMC has sometime difficulties to maximize. You can force it to do it correctly by using the small (http://www.gwenael.org/forum/viewtopic.php?id=199) application (http://www.gwenael.org/forum/viewtopic.php?id=199). You can use it in addition of the pssuspend application (http://www.gwenael.org/forum/viewtopic.php?id=5) if you only want to suspend/restore XBMC, or in addtion with the pskill application (http://www.gwenael.org/forum/viewtopic.php?id=6) if you want to close/restart XBMC. So you final script will look something similar to this :

Code:
pssuspend XBMC.exe
cd "C:\Program Files (x86)\the elder scrolls v skyrim"
tesv.exe
pssuspend -r XBMC.exe
nircmd win max process XBMC.exe

Some application/game also use launcher executable. For example you need to launch start.exe that will launch game.exe. If it is the case, the previous script will not work because it will restore XBMC once the launcher executable will closed... but the game.exe application will still active. In this case you need to write a script that will monitor both processes (launcher.exe ans game.exe) and that will restore XBMC, onyl when this 2 processes will be closed. You can do this by creating a small autoitscript :

Code:
Run ( 'pssuspend XBMC.exe' )
Run ( '"C:\Program Files (x86)\game\launcher.exe"' )
ProcessWaitClose ( "launcher.exe" )
ProcessWaitClose ( "game.exe" )
Run ( 'pssuspend -r XBMC.exe' )
WinSetState("XBMC", "", @SW_MAXIMIZE)

Advanced Launcher | Manual | WiKi | Forums | Tutorials | Gallery | GitHub | Archives | Donate

(This post was last modified: 2012-05-13 19:30 by Angelscry.)
find quote
johnnycash138 Offline
Junior Member
Posts: 18
Joined: Jan 2013
Reputation: 0
Post: #5
(2012-05-13 19:23)Angelscry Wrote:  XBMC has sometime difficulties to maximize. You can force it to do it correctly by using the small (http://www.gwenael.org/forum/viewtopic.php?id=199) application (http://www.gwenael.org/forum/viewtopic.php?id=199). You can use it in addition of the pssuspend application (http://www.gwenael.org/forum/viewtopic.php?id=5) if you only want to suspend/restore XBMC, or in addtion with the pskill application (http://www.gwenael.org/forum/viewtopic.php?id=6) if you want to close/restart XBMC. So you final script will look something similar to this :

Code:
pssuspend XBMC.exe
cd "C:\Program Files (x86)\the elder scrolls v skyrim"
tesv.exe
pssuspend -r XBMC.exe
nircmd win max process XBMC.exe

Some application/game also use launcher executable. For example you need to launch start.exe that will launch game.exe. If it is the case, the previous script will not work because it will restore XBMC once the launcher executable will closed... but the game.exe application will still active. In this case you need to write a script that will monitor both processes (launcher.exe ans game.exe) and that will restore XBMC, onyl when this 2 processes will be closed. You can do this by creating a small autoitscript :

Code:
Run ( 'pssuspend XBMC.exe' )
Run ( '"C:\Program Files (x86)\game\launcher.exe"' )
ProcessWaitClose ( "launcher.exe" )
ProcessWaitClose ( "game.exe" )
Run ( 'pssuspend -r XBMC.exe' )
WinSetState("XBMC", "", @SW_MAXIMIZE)
im having trouble with this autoscript, i need it to run skyrim script extender and suspend xbmc, could you give an example? the code is a bit confusing for me, thank you.
find quote
Angelscry Offline
Skilled Python Coder
Posts: 2,686
Joined: Sep 2010
Reputation: 37
Location: MTL, Canada
Post: #6
(2013-01-17 21:31)johnnycash138 Wrote:  
(2012-05-13 19:23)Angelscry Wrote:  XBMC has sometime difficulties to maximize. You can force it to do it correctly by using the small (http://www.gwenael.org/forum/viewtopic.php?id=199) application (http://www.gwenael.org/forum/viewtopic.php?id=199). You can use it in addition of the pssuspend application (http://www.gwenael.org/forum/viewtopic.php?id=5) if you only want to suspend/restore XBMC, or in addtion with the pskill application (http://www.gwenael.org/forum/viewtopic.php?id=6) if you want to close/restart XBMC. So you final script will look something similar to this :

Code:
pssuspend XBMC.exe
cd "C:\Program Files (x86)\the elder scrolls v skyrim"
tesv.exe
pssuspend -r XBMC.exe
nircmd win max process XBMC.exe

Some application/game also use launcher executable. For example you need to launch start.exe that will launch game.exe. If it is the case, the previous script will not work because it will restore XBMC once the launcher executable will closed... but the game.exe application will still active. In this case you need to write a script that will monitor both processes (launcher.exe ans game.exe) and that will restore XBMC, onyl when this 2 processes will be closed. You can do this by creating a small autoitscript :

Code:
Run ( 'pssuspend XBMC.exe' )
Run ( '"C:\Program Files (x86)\game\launcher.exe"' )
ProcessWaitClose ( "launcher.exe" )
ProcessWaitClose ( "game.exe" )
Run ( 'pssuspend -r XBMC.exe' )
WinSetState("XBMC", "", @SW_MAXIMIZE)
im having trouble with this autoscript, i need it to run skyrim script extender and suspend xbmc, could you give an example? the code is a bit confusing for me, thank you.
I need more information. What is skyrim script extender? Where is located the skyrim script extender executable file?

Advanced Launcher | Manual | WiKi | Forums | Tutorials | Gallery | GitHub | Archives | Donate

find quote
johnnycash138 Offline
Junior Member
Posts: 18
Joined: Jan 2013
Reputation: 0
Post: #7
(2013-01-17 21:36)Angelscry Wrote:  
(2013-01-17 21:31)johnnycash138 Wrote:  
(2012-05-13 19:23)Angelscry Wrote:  XBMC has sometime difficulties to maximize. You can force it to do it correctly by using the small (http://www.gwenael.org/forum/viewtopic.php?id=199) application (http://www.gwenael.org/forum/viewtopic.php?id=199). You can use it in addition of the pssuspend application (http://www.gwenael.org/forum/viewtopic.php?id=5) if you only want to suspend/restore XBMC, or in addtion with the pskill application (http://www.gwenael.org/forum/viewtopic.php?id=6) if you want to close/restart XBMC. So you final script will look something similar to this :

Code:
pssuspend XBMC.exe
cd "C:\Program Files (x86)\the elder scrolls v skyrim"
tesv.exe
pssuspend -r XBMC.exe
nircmd win max process XBMC.exe

Some application/game also use launcher executable. For example you need to launch start.exe that will launch game.exe. If it is the case, the previous script will not work because it will restore XBMC once the launcher executable will closed... but the game.exe application will still active. In this case you need to write a script that will monitor both processes (launcher.exe ans game.exe) and that will restore XBMC, onyl when this 2 processes will be closed. You can do this by creating a small autoitscript :

Code:
Run ( 'pssuspend XBMC.exe' )
Run ( '"C:\Program Files (x86)\game\launcher.exe"' )
ProcessWaitClose ( "launcher.exe" )
ProcessWaitClose ( "game.exe" )
Run ( 'pssuspend -r XBMC.exe' )
WinSetState("XBMC", "", @SW_MAXIMIZE)
im having trouble with this autoscript, i need it to run skyrim script extender and suspend xbmc, could you give an example? the code is a bit confusing for me, thank you.
I need more information. What is skyrim script extender? Where is located the skyrim script extender executable file?
it is in my custom skyrim directory, c\my program files\the elder scrolls v skyrim\ im not sure exactly what the script extender does but you need it for certain mods, you have to launch the skse_loader.exe which activates the mod then loads TESV.exe, but i need xbmc to stay suspended while TESV.exe is on because skse_loader is only on for a few seconds. sorry if i dont explain very well, i dont type much. do you need any more info?
find quote
Angelscry Offline
Skilled Python Coder
Posts: 2,686
Joined: Sep 2010
Reputation: 37
Location: MTL, Canada
Post: #8
(2013-01-17 21:46)johnnycash138 Wrote:  
(2013-01-17 21:36)Angelscry Wrote:  
(2013-01-17 21:31)johnnycash138 Wrote:  im having trouble with this autoscript, i need it to run skyrim script extender and suspend xbmc, could you give an example? the code is a bit confusing for me, thank you.
I need more information. What is skyrim script extender? Where is located the skyrim script extender executable file?
it is in my custom skyrim directory, c\my program files\the elder scrolls v skyrim\ im not sure exactly what the script extender does but you need it for certain mods, you have to launch the skse_loader.exe which activates the mod then loads TESV.exe, but i need xbmc to stay suspended while TESV.exe is on because skse_loader is only on for a few seconds. sorry if i dont explain very well, i dont type much. do you need any more info?
According to your explain the autoit script must be like this :

Code:
Run ( 'pssuspend XBMC.exe' )
Run ( '"C:\my program files\the elder scrolls v skyrim\skse_loader.exe"' )
ProcessWait("TESV.exe")
ProcessWaitClose ( "skse_loader.exe" )
ProcessWaitClose ( "TESV.exe" )
Run ( 'pssuspend -r XBMC.exe' )
WinSetState("XBMC", "", @SW_MAXIMIZE)

This script works like this :
  • XBMC is suspended by the script.
  • skse_loarder.exe is started started by the script.
  • the script is paused until tesv.exe was started by skse_loarder.exe.
  • the script is paused until skse_loarder.exe is closed.
  • the script is paused until tesv.exe is closed (meaning that you have quit the game).
  • XBMC is restored by the script.
  • XBMC is maximized by the script.
Just put this into a .au3 file and compile it into .exe using autoit. Then start this .exe with Advanced Launcher. You will also to install pstools on your system to use the psuspend application.

Advanced Launcher | Manual | WiKi | Forums | Tutorials | Gallery | GitHub | Archives | Donate

(This post was last modified: 2013-01-17 22:20 by Angelscry.)
find quote
johnnycash138 Offline
Junior Member
Posts: 18
Joined: Jan 2013
Reputation: 0
Post: #9
(2013-01-17 22:19)Angelscry Wrote:  
(2013-01-17 21:46)johnnycash138 Wrote:  
(2013-01-17 21:36)Angelscry Wrote:  I need more information. What is skyrim script extender? Where is located the skyrim script extender executable file?
it is in my custom skyrim directory, c\my program files\the elder scrolls v skyrim\ im not sure exactly what the script extender does but you need it for certain mods, you have to launch the skse_loader.exe which activates the mod then loads TESV.exe, but i need xbmc to stay suspended while TESV.exe is on because skse_loader is only on for a few seconds. sorry if i dont explain very well, i dont type much. do you need any more info?
According to your explain the autoit script must be like this :

Code:
Run ( 'pssuspend XBMC.exe' )
Run ( '"C:\my program files\the elder scrolls v skyrim\skse_loader.exe"' )
ProcessWait("TESV.exe")
ProcessWaitClose ( "skse_loader.exe" )
ProcessWaitClose ( "TESV.exe" )
Run ( 'pssuspend -r XBMC.exe' )
WinSetState("XBMC", "", @SW_MAXIMIZE)

This script works like this :
  • XBMC is suspended by the script.
  • skse_loarder.exe is started started by the script.
  • the script is paused until tesv.exe was started by skse_loarder.exe.
  • the script is paused until skse_loarder.exe is closed.
  • the script is paused until tesv.exe is closed (meaning that you have quit the game).
  • XBMC is restored by the script.
  • XBMC is maximized by the script.
Just put this into a .au3 file and compile it into .exe using autoit. Then start this .exe with Advanced Launcher. You will also to install pstools on your system to use the psuspend application.
i already have pstools and i use them, i just didnt know how to make the script wait for skyrim to quit, thank you!
find quote
johnnycash138 Offline
Junior Member
Posts: 18
Joined: Jan 2013
Reputation: 0
Post: #10
(2013-01-17 22:23)johnnycash138 Wrote:  
(2013-01-17 22:19)Angelscry Wrote:  
(2013-01-17 21:46)johnnycash138 Wrote:  it is in my custom skyrim directory, c\my program files\the elder scrolls v skyrim\ im not sure exactly what the script extender does but you need it for certain mods, you have to launch the skse_loader.exe which activates the mod then loads TESV.exe, but i need xbmc to stay suspended while TESV.exe is on because skse_loader is only on for a few seconds. sorry if i dont explain very well, i dont type much. do you need any more info?
According to your explain the autoit script must be like this :

Code:
Run ( 'pssuspend XBMC.exe' )
Run ( '"C:\my program files\the elder scrolls v skyrim\skse_loader.exe"' )
ProcessWait("TESV.exe")
ProcessWaitClose ( "skse_loader.exe" )
ProcessWaitClose ( "TESV.exe" )
Run ( 'pssuspend -r XBMC.exe' )
WinSetState("XBMC", "", @SW_MAXIMIZE)

This script works like this :
  • XBMC is suspended by the script.
  • skse_loarder.exe is started started by the script.
  • the script is paused until tesv.exe was started by skse_loarder.exe.
  • the script is paused until skse_loarder.exe is closed.
  • the script is paused until tesv.exe is closed (meaning that you have quit the game).
  • XBMC is restored by the script.
  • XBMC is maximized by the script.
Just put this into a .au3 file and compile it into .exe using autoit. Then start this .exe with Advanced Launcher. You will also to install pstools on your system to use the psuspend application.
i already have pstools and i use them, i just didnt know how to make the script wait for skyrim to quit, thank you!
i have another question, is there a code for autoit scripts to hide the console window? not minimize it, but make it completely hidden from view.
find quote
Post Reply