Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider becoming a contibuting member by either clicking this text or the Patreon link on the right.

Patreon

"Launch After" command doesn't seem to work


Recommended Posts

Posted

Hi all, I am trying to use the Launch After command with my PC games, to start pskill in order to finish all running cmd.exe processes. (I start my PC games via a .bat file)

This doesn't seem to work however, I can't get this line to work, and have to kill the cmd.exe processes manually before Gameex can return. Any suggestions how this works?

This is my ini file:

[Emulator_24]
Enabled=True
STARTPAGENAME=PC Games
TITLETEXT=PC Games
StartPageLogo=PC
ROMFilter=*.bat;*.lnk
RomsInFolders=False
RomPath=D:\Games\Shortcuts
SnapPath=D:\Games\Artwork\Screenshot
WorkingPath=D:\Games\Shortcuts
MapKeys=False
WaitBeforeKeys=
SendKeys=
ReplaceDash=False
ReplaceUnder=True
Capitals=False
RemoveBrackets=True
ShowDesktop=True
Debug=False
MAPFile=
AlsoLaunch=
Command=[ROMPath]\[RomFile]
OLDatZip=
TitlePath=D:\Games\Artwork\Title
BoxPath=D:\Games\Artwork\Box
CartPath=D:\Games\Artwork\CD
LaunchBefore=
LaunchAfter=D:\Games\pckill.bat
configFile=
ExcludedFiles=
CustomBackground=pcgames.png
PlayMusic=
PCGame=
DATABASE=
DumbyValue=
GamesIn7Zips=
PlayInScreenSaver=True
lastgame=
ShowMostPlayed=False
DontShowInfo=
PlaySelectionMusic=
SelectionMusicFolder=
ManualPath=
ControlPanelPath=D:\Games\Artwork\Controls
InstructionsPath=
RandomMostPlayed=False
CDCheck=
CDCheckFile=

The file pckill.bat goes as follows:

@ECHO OFF
C:\Emulation\Xpadder\Profiles\blank.xpadderprofile
C:\WINDOWS\system32\pskill cmd.exe

Any ideas what I am missing?

Cheers,

Arjen

Posted
Hi all, I am trying to use the Launch After command with my PC games, to start pskill in order to finish all running cmd.exe processes. (I start my PC games via a .bat file)

This doesn't seem to work however, I can't get this line to work, and have to kill the cmd.exe processes manually before Gameex can return. Any suggestions how this works?

This is my ini file:

[Emulator_24]
Enabled=True
STARTPAGENAME=PC Games
TITLETEXT=PC Games
StartPageLogo=PC
ROMFilter=*.bat;*.lnk
RomsInFolders=False
RomPath=D:\Games\Shortcuts
SnapPath=D:\Games\Artwork\Screenshot
WorkingPath=D:\Games\Shortcuts
MapKeys=False
WaitBeforeKeys=
SendKeys=
ReplaceDash=False
ReplaceUnder=True
Capitals=False
RemoveBrackets=True
ShowDesktop=True
Debug=False
MAPFile=
AlsoLaunch=
Command=[ROMPath]\[RomFile]
OLDatZip=
TitlePath=D:\Games\Artwork\Title
BoxPath=D:\Games\Artwork\Box
CartPath=D:\Games\Artwork\CD
LaunchBefore=
LaunchAfter=D:\Games\pckill.bat
configFile=
ExcludedFiles=
CustomBackground=pcgames.png
PlayMusic=
PCGame=
DATABASE=
DumbyValue=
GamesIn7Zips=
PlayInScreenSaver=True
lastgame=
ShowMostPlayed=False
DontShowInfo=
PlaySelectionMusic=
SelectionMusicFolder=
ManualPath=
ControlPanelPath=D:\Games\Artwork\Controls
InstructionsPath=
RandomMostPlayed=False
CDCheck=
CDCheckFile=

The file pckill.bat goes as follows:

@ECHO OFF
C:\Emulation\Xpadder\Profiles\blank.xpadderprofile
C:\WINDOWS\system32\pskill cmd.exe

Any ideas what I am missing?

Cheers,

Arjen

Well it maybe because LNK and Bats terminate after they are launched.

For fun try launching something by the executable.

Posted

OK, after some experimenting I found a solution for my problem.

In my setup, I like to launch some games via a batchfile, in order to use some extra programs (for example an xpadder profile) alongside the game.

My problem was that the cmd.exe window of the batchfile stayed open after shutting down the game, thus preventing gameex to take the wheel again.

I tried to solve this by using pskill in the "Launch after" line, but that didn't work.

I realise now that as long as the cmd.exe window isn't closed, Gameex never gets to the "Launch after" command line. The solution I used was to close the cmd.exe window manually, to return to Gameex. Not very elegant.

After some searching on the internet I found a freeware program called Hotkey Manager (Link), which solved my problem.

With this little utility you can launch applications by assigning a hotkey combination to it. I assigned the hotkey combo CTRL+SHIFT+P to launch the PCKill.bat file (see original post), and this hotkey combo is assigned to my "exitbutton" on the joystick via xpadder.

For example, when I want to exit a dosbox game I press the exitbutton, which generates CTRL+F9 (closing dosbox) and CTRL+SHIFT+P (closing all open cmd.exe windows), and Gameex takes over again.

I am glad that this works for me, because it has been a longstanding nagging problem on my setup.

Regards,

Arjen

Posted

Sounds like a complicated solution, but sometimes that's the only way. The only other thing I could suggest if you were interested in changing the way you load games is to use AHK scripts rather than batch files. You get more control with that and you can even set up hot keys right in the script. It makes things a nice, clean, single file solution. I wouldn't change things as long as what you have is working, but it might be a better way to go if you redo things or others read this thread.

Nice work!

Posted

But don't you have the same problem then? Gameex will see the ahk script as the original launched program and wait for it to close before returning to the main menu?. How do you solve this, or does an ahk script automatically continue and close AFTER you close the emulator?

Posted

You can set it up to work however you want. AHK scripts are just programs that do whatever you code them to do. If you want them to run something and then exit, you can do that. If you want the script to stay active until you kill it, that also can be done. If you want it to stay active until another process ends, that's easily doable too. I wrote a little wrapper for MAME called MAME_Launcher that launches MAME as I want and then waits till the mame.exe process no longer exists. It then ends that AHK script and GameEx takes over.

AHK is just a programming language, so it isn't limited by anything other than your imagination, creativity, and coding capabilities! If you need help with the coding, just ask and we'll try to help out the best we can.

Posted
You can set it up to work however you want. AHK scripts are just programs that do whatever you code them to do. If you want them to run something and then exit, you can do that. If you want the script to stay active until you kill it, that also can be done. If you want it to stay active until another process ends, that's easily doable too. I wrote a little wrapper for MAME called MAME_Launcher that launches MAME as I want and then waits till the mame.exe process no longer exists. It then ends that AHK script and GameEx takes over.

AHK is just a programming language, so it isn't limited by anything other than your imagination, creativity, and coding capabilities! If you need help with the coding, just ask and we'll try to help out the best we can.

Thanks bkenobi, I'll look into it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...