Jump to content
⚠ Known Issue: Media on User Profiles ×

SKSE64 leaving save fragments in save folder


7531Leonidas

Recommended Posts

 

 

Of course this simple script can be expanded to do more fancy stuff, like check all profiles.

I updated my script to check all profiles for orphans. If you want yours to do that, use these instructions instead.

 

Create a batch named delete_skse_fragments.bat in your Mod Organizer profiles folder. On my system it's W:\apps\SkyrimSE\ModOrgainizer2\profiles\delete_skse_fragments.bat

@ECHO OFF
cd /d "%~dp0"
for /f "delims=*" %%a in ('dir /b /ad') do if exist "%%a\saves" for /f "delims=*" %%b in ('dir "%%a\saves\*.skse" /b') do if not exist "%%a\saves\%%~nb.ess" del "%%a\saves\%%b"

I use * as a delimiter instead of ; because no file or folder can have * in the name.

 

Now there's no need to use a shortcut, so create a launcher to call this script directly and then start SKSE.

 

<SteamPath>\SteamApps\common\Skyrim Special Edition\skse64_launcher.bat

@ECHO OFF
CALL "W:\apps\SkyrimSE\ModOrgainizer2\profiles\delete_skse_fragments.bat"
cd /d "%~dp0"
start "SKSE Loader" /D "%~dp0" "%~dp0skse64_loader.exe"

Add skse64_launcher.bat to MO executables menu, and use it to start Skyrim instead of SKSE.

 

Working perfectly, thanks for taking the trouble!

Link to comment
Share on other sites

  • 2 weeks later...

I am not sure this is the right place to ask my question, but I can't figure out where to ask it. I do not have any problem with orphaned co-saves. I also use NMM as a mod manager and have no profiles, so all of my characters play with the same load order. I use an early version of the NamedQuicksaves Mod and have a hotkey set to create manual saves which I do periodically. I have all autosaves disabled (although I still get them when entering Apocchapha or when first entering Solstheim and the stupid one before you encounter the Caller which I delete). When I am playing some characters, I notice that the save takes a lot longer than when playing other characters, even when they are at the same level. The characters that have fast save times have much smaller SKSE cosave files. The larger the SKSE cosave file, the longer it takes to do a save. Why are some of the cosave files so much larger than others? As an example, I have one character whose ESS file is 6600 kb and his skse cosave is 504KB. His saves are fast. I have another character whose save file is 6000 KB whose cosave file is 2848 Kb, and another with a save file of 7200KB and a cosave file of 3600. Saves with those characters are slow (several seconds). My question is what is causing this difference?

Link to comment
Share on other sites

I am not sure this is the right place to ask my question, but I can't figure out where to ask it. I do not have any problem with orphaned co-saves. I also use NMM as a mod manager and have no profiles, so all of my characters play with the same load order. I use an early version of the NamedQuicksaves Mod and have a hotkey set to create manual saves which I do periodically. I have all autosaves disabled (although I still get them when entering Apocchapha or when first entering Solstheim and the stupid one before you encounter the Caller which I delete). When I am playing some characters, I notice that the save takes a lot longer than when playing other characters, even when they are at the same level. The characters that have fast save times have much smaller SKSE cosave files. The larger the SKSE cosave file, the longer it takes to do a save. Why are some of the cosave files so much larger than others? As an example, I have one character whose ESS file is 6600 kb and his skse cosave is 504KB. His saves are fast. I have another character whose save file is 6000 KB whose cosave file is 2848 Kb, and another with a save file of 7200KB and a cosave file of 3600. Saves with those characters are slow (several seconds). My question is what is causing this difference?

 

Nothing wrong with asking here, it's just that very few people will see the question. I suggest posting your problem in the right place so that more experts are likely to see it.

I would go back to the top of this forum, and create a new topic. Or, just click here to create a new topic.

Edited by Tony_OQuinn
Link to comment
Share on other sites

  • 1 year later...

That's a bug in SKSE64. It's not cleaning the co-save files when the main save gets deleted by the game. So there will be a bunch of autosave leftovers after extended play. When you're finished with a game session make a regular (not quicksave or autosave) save and then you can go into the save folder and delete all of the quick and autosave files without losing anything of value.

 

I did that for a while before eventually breaking down and writing this little WSH script to only delete any SKSE files that don't have a matching ESS file. It's not pretty but gets the job done with a simple double-click.

// CleanLeftoverCosaves.js - a WSH script to clean leftover SKSE cosave files
var fso = new ActiveXObject("Scripting.FileSystemObject");
var folder = fso.GetFolder(".");
var subFlds = new Enumerator(folder.Files);
var files = {}
for (; !subFlds.atEnd(); subFlds.moveNext()) {
	var n = subFlds.item().name
	if (n.match(".ess"))
		files[n.replace(".ess", "")] = 1
}
subFlds = new Enumerator(folder.Files);
for (; !subFlds.atEnd(); subFlds.moveNext()) {
	var n = subFlds.item().name
	if (n.match(".skse"))
		if (!files[n.replace(".skse", "")])
			subFlds.item().Delete()
}

If you save that into a file named "CleanLeftoverCosaves.js" and put it in your saves folder you can click on it to clean the leftovers whenever you like. The script needs to be in the saves folder but you can right-click on it and create a shortcut then put that shortcut somewhere easier to access. (Alternately you could edit the second line so that GetFolder looks in a specific folder instead of "." which is the same as the script itself but I find making a shortcut much easier than looking up folder path names.)

cdcooley, I am running on Windows 7. I have created the .js file as you've shown, and saved it to my save games folder, but when I double click on it, nothing happens. I was wondering is it because my Windows is too old a version to have the program that runs .js files on it?

 

That's just a minor set back, though, I'm just glad this thread has explained what my problem is. I have over half a gig used on over 900 save files now, and I'll just do a manual delete of all the ones that aren't matched up with .ess files. If I can't use this script, I can still continue with manual deletes.

Link to comment
Share on other sites

  • 3 weeks later...

Here is a quick .bat alternative I wrote if you can't get the js file to work:

@echo off
set count=0
for %%i in ("*.skse") do (
  if not exist "%%~ni.ess" (
    del "%%i"
    set /a count = count + 1
  )
)
echo Cleaned up %count% lonely .skse files
pause
Just save that with a '.bat' extension (I saved mine as 'cleanup_skse.bat', but you can name it whatever) in the same folder as your saves and double click it to run.

 

EDIT: I guess I'm blind, didn't see that basically the same script was already posted on page 2. Sorry for the bump :tongue:

Link to comment
Share on other sites

  • 1 year later...
ust save that with a '.bat' extension (I saved mine as 'cleanup_skse.bat', but you can name it whatever) in the same folder as your saves and double click it to run.

 

Thanks dude, that is good. Cuz dat JS file from first page is not working for me at all(always gives some Microsoft error).

 

Link to comment
Share on other sites

  • 4 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...