Jump to content
LaunchBox Community Forums

Cant Save Shutdown.bat file under games


Go to solution Solved by klitaa0,

Recommended Posts

Posted

Hi

I'm new to the forum hope I'm in the right place 

I have created a shutdown bat file in the manually added games area. 

I right click on the so called game called Shutdown which has a administrator privileged shortcut to the actual shutdown bat file and it works fine.

The Shutdown game displays it's unavailable on the right hand side of launchbox but it works fine if you right click the icon.

The problem is exiting from launch the game Shutdown which is the bat file doesnt save on return

Please any advice would be great

Cheers

Andy

Posted
3 hours ago, klitaa0 said:

Please any advice would be great

To clarify:

  1. You created a batch file (that does something) called Shutdown.bat
  2. You then created a shortcut for that batch file.  Shutdown.bat - Shortcut.lnk
  3. You edited the shortcut, clicked Advanced and checked Run as administrator
  4. You imported the .lnk file into LaunchBox as "Other" (vs. as a ROM file.)
    1.   aka, it's not using an emulator as shown in that "games" Emulation section
  5. If you right-click the "game" and select Play, it works
  6. ...but in the Game Details panel (right side) it shows Unavailable. (where others would show Play)
  7. After right-clicking and selecting Play, the batch file 'does its thing'. But when returning to LaunchBox, the game is no longer there.
    1. Unless you mean something different by "doesn't save on return"?

Is that correct?  Because 5) and 6) contradict each other and doesn't make sense.

Can you edit your Shutdown "game" (in LaunchBox) and share some screenshots

  • The (main) Metadata section
  • The Launching section
  • The Emulation section

 

Posted

Firstly Thankyou for replying.

The third screen shot by right clicking and selecting Additional App the shutdown batch file works and closes launchbox.

When I reopen launchbox the Shutdown icon, program and all has not been saved.

Any clues would be great

 

Cheers

Andy

 

 

image.thumb.png.377e0189a096a281327eafe2cfc6b483.pngimage.thumb.png.7c270b797f227bd1f72e8ac25456b4b1.pngimage.thumb.png.c1dd6c799bc5ef98f41a79fbd91860de.png

 

 

 

 

 

Posted
11 minutes ago, klitaa0 said:

by right clicking and selecting Additional App the shutdown batch file works and closes launchbox.

Ahh... Since this is "its own game", instead of adding an Additional App to itself, you want the Application Path to be in the games Launching section.

image.thumb.png.ac273454b3e6409eac1e32568929c2ed.png

Then remove the Additional App.

Also, in the Emulation section (3 below Launching), be sure that Use an emulator to play this game (primarily for console games) is un-checked.

Posted

Thanks Joe

That worked I can now shutdown Launchbox and my PC without right clicking the Shutdown Icon.

But the problem I still have is when I reboot my PC and run Launchbox the Shutdown Games Icon is gone, nothing is saved.

Launchbox also doesn't save any changes if I exit launchbox via the normal exit menu.

Cheers

Andy

 

Posted
22 minutes ago, klitaa0 said:

Thanks Joe

That worked I can now shutdown Launchbox and my PC without right clicking the Shutdown Icon.

But the problem I still have is when I reboot my PC and run Launchbox the Shutdown Games Icon is gone, nothing is saved.

Launchbox also doesn't save any changes if I exit launchbox via the normal exit menu.

Glad to hear it (mostly) worked. :)  

Sounds like what's happening is LaunchBox is being forced closed and changes aren't being saved.

The process:  When you close LaunchBox (normally), the UI will close and [hiding] in the background, LaunchBox saves any changes you made.

Theory:  When you close LaunchBox, you don't want to "see" it so you can "go about your other business".  Changes you made are saved (again, in the background) for when you next start LaunchBox.

The fix:  Don't do it that way. ;) 

Alternate:  Use Big Box and then you can shut down the PC from its System Menu.  System Menu < Shut Down.

Plan "B":  Use a batch file start LaunchBox:

  • start LB
  • (you play games or whatever)
  • you exit LB normally
  • it waits for LB background processes to finish
  • then shuts down the PC.
@echo off
cd "D:\LaunchBox"

start "" "LaunchBox.exe"
:waitloop
tasklist /FI "IMAGENAME eq LaunchBox.exe" | find /I "LaunchBox.exe" >nul
if not errorlevel 1 (
    timeout /t 2 >nul
    goto waitloop
)

rem start your shutdown process here
rem shutdown -s -f

Change line #2 to your LaunchBox location. 

The commented out "shutdown" line will shut down (-s) the PC and force close (-f) any lingering apps (so it doesn't get hung up) and does not require it to be ran as Administrator (assuming you're logged on as Admin on your PC).  Or at least that's supposed to work that way. 

"shutdown -s -f" NOT TESTED BY ME!

You can create a shortcut to 'this' batch file and set Run to Minimized to get the Command Prompt window out of the way.

Posted

Joe

Again thanks for your help.

I used the batch file you suggested and Launchbox starts fine used a shortcut so ran it minimized so no command prompt

Created my Shutdown batch file under games but when I exit launchbox it still doesn't save anything.

I'm lost to understand why its not saving this Batch file under games.

It does now show batch file as available and clicking it under games works

It just cant be saved. 

The whole reason for having this type of shutdown for my Arcade Machine is that the grandkids can shut down the PC without using the mouse.

Obviously other option would to use Bigbox.

 

Cheers

Andy

 

 

  • Solution
Posted

Fixed it

Created game called shutdown with batch file to shutdown under a dos game option, then removed the "Run as Dos"

Exited from Launchbox via my shutdown batch file returned to Launchbox and Game Shutdown batch file was saved correctly.

Andy

  • Game On 1
Posted
2 minutes ago, klitaa0 said:

Fixed it

Created game called shutdown with batch file to shutdown under a dos game option, then removed the "Run as Dos"

Nice!!!  I wonder if in the prior one, was the Additional App removed?  eh... Doesn't matter.

Glad you got it working!

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...