Command line parameter to start the sim in SAFE MODE

Like the title says.

This would be extremely helpful for troubleshooting purposes if we could have a command line parameter or some other mechanism that allows us to boot directly into safe mode.

Currently, the only known way to get safe mode is to crash or force quit the app with alt+F4 or end the process from Task Manager. We then get the prompt to boot normally or in safe mode on restart.

So I’m requesting that we have the option of starting the sim directly in safe mode with something like a -safemode command line switch.

I agree this would be a valuable tool, especially to ensure people are doing performance testing with a “clean slate.” I would prefer a held-key during boot process such as holding Left-ALT or Left-CTRL during sim startup, but anything similar would be easier than the only way we have to do it currently.

2 Likes

Indeed. I don’t care what the mechanism is. I don’t mind having an extra shortcut with a command line switch, but I’m also cool with having to hold down a key while starting the sim as an option. Like you said, anything is be better than the current method.

2 Likes

Good idea. Voted +1.

This is a weird way around your request, but hopefully it helps.

If you drop an empty file called running.lock in this directory, before starting the sim, MSFS will prompt you to use safe mode. This is for MS Store version, not sure what it would be for Steam.

C:\Users\%username%\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalState\running.lock

7 Likes

How is it recorded that the sim was not shut down correctly? I assume it’s something like windows, where a flag is not cleared for an improper shutdown. Perhaps that is something we could manually alter if we wanted to instigate Safe Mode? Possibly something in your MSFS user profile.

If so it might be worth running a tool which will watch that folder structure to see what happens when the sim is shut down gracefully, and when you crash out.

its same for Steam… see also:
https://forums.flightsimulator.com/t/warning-notice-screen-on-start-up-remains/493942/4?u=michamma

1 Like

It drops a file named “running.lock”.

If MSFS exits properly, that file is deleted. If MSFS crashes, that file will be present and checked on next launch of MSFS which goes into safe mode.

4 Likes

Ah, so if we were to manually create that file, say as part of a “Safe Mode” script, we could force the sim to launch in safe mode. If the sim removes that file automatically for a clean shut down from Safe Mode, we wouldn’t need to script its removal either.

Checking another post, this file should be in the “LocalState” folder. So in theory this should work.

copy nul > C:\Users\%USERNAME%\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalState\running.lock

5 Likes

Thanks all for this great tip.
Added the optional file creation to my MSFS startup batch file,

Enter “S” to start in Safe Mode,

with a time out if “S” not hit.

4 Likes

Great info guys. Will do this tonight. This makes things much easier.

That said, it would still be nice to have this option natively in the sim vs having to do a workaround like this. But this will definitely work for now.

2 Likes

The above method to force Safe Mode did not work for me. But I figured out another way to do it.
(I’m using Steam version) => (MSFS is NOT installed in the default location)<==

If I created my own running.lock file (empty file), and put it into

C:\Users(your name)\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalState

But MSFS would still NOT show the Save Mode option. Probably because the file running.lock was not valid (because it had been artificially created).

So I had to find where MSFS was putting the proper running.lock file and move it to the above location.

It turned out MSFS was putting running.lock here:
C:\Users(yourname)\AppData\Roaming\Microsoft Flight Simulator
So, I just move the running.lock file from there to the proper location way up above and now MSFS gives me the Safe Mode option.

3 Likes

of course, these folder not exist for STEAM version and we mentioned the relevant folder for steam users:

In the SU 12 beta, perhaps there no longer is a way to force safe mode. I’m using the beta and if I kill a running MSFS in Task Manager or if I kill MSFS with Alt F4 , then a file called running.lock is NOT created anywhere. And rebooting MSFS will not show the Safe option.
Before SU 12 beta, the method above would force MSFS into the Safe option the next time you booted MSFS. But no longer does this work.

I did a file search and no file named running.lock is located anywhere on my computer after killing MSFS in task manager or with Alt F4.

but then its possible better to discuss that within #su12-beta . May be its new ‘feature’ in su12b or an issue where developers need that feedback :slight_smile:

1 Like

Additionally (or instead) to the command line I would like to have an option once in the sim, for example under the General Options\Misc menu (as a suggestion) that allows restarting the sim in Safe Mode avoiding to have to kill the MSFS.exe application. When making some tests to define if a mod can be the cause of an issue we ask users to empty their community folder. This is good for the mods that have been manually moved there. But in the case of the purchase through the Market Place for example, they are automatically downloaded in the “OneStore” folder (I have the ms-store version). So the only way to disable them is to restart in Safe Mode.