Is there a way to force applications to write into specific folders?

Feb 22, 2018
55
0
130
Hello there, as title says I would really like to know if there is a way to do that. I'm planning to force a game and steam to write in some specific folder so that I can easily backup/save my data. Thanks in advance for help.
 
Feb 22, 2018
55
0
130


No that's not what i was trying to do, save files and cache haven't an option as far as i know.
 

mgallo848

Commendable
The save files can only be written to whatever your default Documents folder is. You can change you default location for Documents though. For example:

My default location for Documents is on my backup drive (F/Documents). That's where Steam saves my game backups.

Why are you worried about Steam cache?
 
Feb 22, 2018
55
0
130


Save files for some games don't get saved inside documents, instead they get saved in some appdata folders. Moving both save files to backup and cache to a new folder for cleaning purposes would greatly speed up the whole process.
 

gardenman

Splendid
Moderator
If the game doesn't have an option within it's settings to change the location of saved games then it's probably not worth attempting.

Games are usually hard coded to use specific folders. You *might* be able to change some system settings (as mentioned above, such as the location of the Documents folder) but it would more trouble than what it's worth.

You could probably set up hard links, symbolic links, or junctions which are complicated and also more trouble than what it's worth. https://superuser.com/questions/343072/how-to-create-a-directory-hard-link-in-windows
I would be careful with the info on that page, study up on it before even considering trying anything there. It's complicated and probably not worth it. You could damage your file system if things aren't done correctly.

It would be much easier to make the backup program backup the specific files/folders rather than trying to change where the game is saving the files/folders. What backup program are you using?

Even running a batch file to copy the specific files/folders to another location which could be backed up would be a better idea.

Here's a good answer that I would agree with:
https://steamcommunity.com/discussions/forum/1/846941710341446302#c2381701715726343376
You may be interested in the links provided there. And there are additional answers too.

I understand what you are trying to do, and what you want, but most software just hasn't been designed to do that, and don't have the options to allow it either. It would make a PC setup much cleaner and easier to use, but individual programmers would all have to agree and change everything. They won't be doing that anytime soon.

One more point I'd like to make is, that if you combine all of your cache and temporary files into a single folder, there could be a conflict. If program one uses a "history.dat" file and program two tries using a "history.dat" file too, one or both programs could crash. If you try to combine cache and temp folders, give them each their own sub-folder.
 
Feb 22, 2018
55
0
130

that's a bummer, i tough there was some kind of stuff you could do like a command in the shortcut like you do with chrome or maybe changing some variable somewhere, I was able to change temp folder file locations and it's much more convenient now for example.

Not using any backup programs at moment, never had chance to download anything.

Regarding sym links I'm already kind of using that solution but I would like to ask you maybe if you can give me any opinion on steammover. I'm actually using that as an alternative to symlinks since as I understood they are a bother to change back if something goes wrong. The problem with that is that i'm not sure if it's doing everything right since when I go to the original location I see that stuff in there again.

Also yea would be really good if they agreed to at least save all stuff inside the steam folder or at least not inside appdata since it's a bother to always go there, unhide folders, hide them back etc. Doesn't help that steam doesn't actually remove all the cache even if you do use the option in the client and you basically have to do it yourself.
 

USAFRet

Titan
Moderator
To move Steam games from drive to drive, or folder to folder...no steammover needed.
That functionality is now built directly into the Steam client. Has been for several years.

Steam games location
In the steam client:
Steam
Settings
Downloads
Steam Library Folders
Add library folder
q24sFfe.png


To move an already installed game
Games library
Right click the game
Properties
Local Files
Move Install Folder
 
Feb 22, 2018
55
0
130


Sorry if I was unclear but i'm not trying to move a game but save file and cache.
 

USAFRet

Titan
Moderator
For backups of specific folders? That's easy. Many tools can do that.

FreeFileSync, SyncBackFree,even Macrrium Reflect will let you select individual folder for a backup.

You can do that all on a schedule, or on demand.
Just find what folders these games save to, and tell the tool to do that.

Don't try to force Steam to change, use a tool that can adapt to how the system is set up.
 
Feb 22, 2018
55
0
130


Unfortunately I haven't access to internet, getting this stuff is hard. Trying to work around what I already have. Regarding steammover it can also move some other stuff, like specific folders, that's why i was using it.
 

gardenman

Splendid
Moderator

Regular shortcuts do have a "Start in" folder (previously known as a "Working Directory") and changing that might force a few smaller apps to use a specific folder. I don't think it will work for most apps these days though.

Any app that I write uses full paths (hard coded). This is safer. For example:
C:\Users\Username\AppData\My Program\Settings.ini
A program that uses a full path like that will ignore the "Start in" folder. Junctions will work though.

I defer to USAFret on Steammover. I've never used it.
steamwindow.png
It appears it does junctions. Therefore if you go to the original location like you said, you WILL see the files (even though they may not actually be physically located there). That's how juntions work (I have very limited knowledge of them). It makes the files appear to be there, and this makes the program using those files think they are there. Or are the files located in the original place and the junction makes it appear as if they are located elsewhere? Hmm...

So forcing apps to use a specific folder for their settings files and saved games, etc, is going to be difficult. Junctions may work, but personally I wouldn't do it.

If your goal is to make it easy to create a backup, you need to get a good backup program. I know you can't download stuff, but I would add "Cobian Backup" to the list above. It's a bit dated but it's a simple file backup program with many options.

If your goal is to have a cleaner file/folder structure for your PC, I wouldn't try it due to the complications of the setup. You would have to know what all files are saved by each app and to what location. Gathering this information would take a long time.
 
Feb 22, 2018
55
0
130

Could you be more specific about this start in tab in the shortcuts please? I don't think I ever saw that thing anywhere. Is that your screenshot? If you have steam installed could you check if that start in folder does anything please?

Aren't these apps I said using an hardcoded paths as well?

How do i know that really worked as intented? For example when I posted this same question on steam forum some member linked me a screenshot and it does really work different from what I see with steammover. For example he see the folder in the other location, while if i right click it, it's still there but obviously the folder doesn't weight the normal mb of the other part but still that makes me confusing.
https://steamuserimages-a.akamaihd.net/ugc/929311677222146213/3842A902A328F6F34487314F12B7CCDAD046C589/

Why wouldn't you do it? Unfortunately i cannot access internet to download stuff and backup program which only works for savefile and not cache aren't an option.

What do you mean? Doesn't really seem complicated, I have all folders close together instead of having to unhide appdata and hide it back each time, or maybe am I missing something?
 

gardenman

Splendid
Moderator

The "Start in" folder is shown on all regular shortcut properties to applications. Here's a screen shot I found on the net: [Screen Shot]. Like I said, most apps will probably ignore this setting these days and use hard coded paths.

That Steammover screen shot is not mine. It's from the first site that I found while searching for it. I do have Steam installed and 5 or 10 games with it. I do not use Steammover. The Steam shortcut itself does have a Start In property however it's probably completely ignored. You could test this by changing to it (be sure to create the folder first) and trying to run it. If things go wrong, don't ask me why. I wouldn't do it. Steam itself is just a game launcher. Steam doesn't control where the games save their own saved files.

Steammover should work on apps that use hard coded paths. I wouldn't do this for several reasons:

#1. The complexity of the setup. Depending on what all you want saved to your custom folders, determining where each app/game saves each of their own files to is going to be difficult. If you just want to redirect saved games from a few games then Steammover may do it for you and everything should be OK. Some games save their files to AppData, some save them to Documents, others may save them elsewhere.

#2. The possibility of things going wrong. Using folder links like that may work for most apps, maybe all, I just don't know. If you set up one of those folder links incorrectly though (such as accidentally linking two system folders) you may end up with an unbootable system.

The way I read your above messages, you want to set your whole system up to save all files to your own custom folders to make it easy to backup. If you only want to do this for only a few apps, only saved games and such, then you should be fine. If you really want a full backup (all game settings, game addons for example, saved games, etc) then determining where all of those files are saved is going to take hours of study and a very complicated setup.

How do you know that it really worked as intended? Well if the files are accessible from both locations and the application still works then you were successful. I said my knowledge of these links are limited. I haven't really had time to test them out. I have a test system and could do that and might do so later and get back to you on that. There may be different types of links. Maybe Steammover only uses one type of the links. Maybe there are better apps that would make the links different. All questions which I don't have the answers for (at this time).
 
Feb 22, 2018
55
0
130

Oh got that, i get what you are trying to say, but it's not really complex to just move htmlcache and savedata since i knew already where they were located, probably this would be harder if you were to install many more games, but thankfully for me this is not the case and lastly like I already said, it's more tme consuming to access the appdata folder each time.

The screenshot i linked isn't mine by the way but is from a steam user that tryed to help. If you check the location his files are all located in another drive (D in this case) while with the setup i had with steammover if i check the location of the folder, it's still located in the original location. So the question is, is it writing to both location and so wasting disk space and writes or is it really writing where I said.

I appreciate your help and I get it that it's not really easy when you aren't actually using the program yourself, I just would like to say don't feel forced to install it just for this
 

gardenman

Splendid
Moderator
I still wouldn't combine all temporary folders into a single folder and recommend using sub-folders. There's a small but real possibility of two programs using the same temporary filename, especially as I said above like "History.dat" or "index.dat" types of files. So I would use something like:
C:\TempFiles\FireFox
C:\TempFiles\Chrome
C:\TempFiles\SomeOtherProgram
Also, with multiple programs using the same folder, you could have 1000's of temporary files in a single folder. This would make accessing them take slightly more time (mostly unnoticeable, but yet it will slow things down).

I just downloaded SteamMover and installed it on my test system. It's version 0.1 which usually means it's a BETA. I couldn't get it to do anything but my test system doesn't have Steam installed. I tried connecting two other folders with Browse and it just doesn't do anything. I tried to run it as Admin and that didn't help. Maybe I missed something, but I'm guessing Steam must be installed.

I downloaded Junction from SysInternals
https://docs.microsoft.com/en-us/sysinternals/downloads/junction
It's a console progam. I tested it and here are the results.
The "C:\Temp\Program1" is the junction (or fake folder).
The "C:\Users\GardenMan\Desktop\TheRealFolder" is the real folder, with a single text file in it.
The "Program1" folder cannot already exist. The Junction creates it (it's sort of a special shortcut to a folder).

Running the program:
ss1.png


Folders afterwards:
ss2.png


After I created the junction, I was able to open the "Test File 1.txt" from the "C:\Temp\Program1" folder. It of course doesn't really exist there, but software thinks it is there. See the status bar on this editor.
ss3a.png


So that's basically how a junction folder should look and act on your system. If you look at the junction folder in Explorer, you should see the little arrow on the lower/left side of the icon which indicates it's a shortcut (or junction). If it looks like that, then the files are only being saved to one place. I couldn't test SteamMover so I don't know if it's working correctly or not.

PS: You don't have to unhide and AppData folder each time just to access it. Unhide it once, create a shortcut to it, rehide it and you can use the shortcut at anytime.

Also, just because you can't see the AppData folder, that doesn't mean Explorer can't access it.
ADFolder.gif
 

USAFRet

Titan
Moderator
I still say use a backup application that will individually access and backup whatever folders you need, in their original location.
I'd hate to see what this conglomeration looks like after a major update, or trying to redo it after an OS reinstall.
 
Feb 22, 2018
55
0
130


Sorry for the delayed answer but I couldn't really answer sooner, due to all the problems that are happening.
I didn't combine them they are in individual folders in the same location, so not possible to trigger an error of that way.

As far as I know despite its name steammover doesn't need steam installed to work, not sure where the problem may be.
Regarding your test it does seem different from what I have right now. Basically correct me if i'm wrong but you moved the file from desktop to a custom location you made in temp, is that right? Why is the filesize the same in both folders, shouldn't it be just a shortcut? With steammover the original folder in appdata gets that arrow thing (the real folder), while in your case it's the opposite? This does really seems confusing :\

Also thanks for the advice regarding how to browse there faster, had no idea about it, will certainly speed the process, even tough now I found a way to not let steam create any cache with command -nocache and -no-browser. Not sure what the downside of that method may be but for now nothing appeared inside the htmlcache of steam.
 
Feb 22, 2018
55
0
130


Thanks for the advice, but believe me I have no access to the internet. I know it's hard to believe but I have no way of using solutions like these.
 

gardenman

Splendid
Moderator

The file on my desktop never actually moved. Only a fake folder was created in temp that makes it appear as if the file is there, when it's really not. If I delete the file from the desktop folder, it will disappear out of the fake temp folder. If I deleted it from the temp fake folder, it would disappear from the desktop. Both locations point to the same identical file. The file is not a shortcut because that's how junctions work. The folder itself may appear to be a regular shortcut (with the arrow on the icon) but it really isn't either, it's a special type of shortcut. The files appear to be the same size but like I said, only 1 file exist.

If you had a folder with 10 gigs of game files and you created a junction from to a Games2 folder, it would appear as if ALL of those files where in the Games2 folder. It would look real. But, there's only 1 copy of the files. It will still take up the same space on your disk, it won't double the space used.

It's my guess that SteamMover actually moves the real folder to a new location, then creates the junction (or fake folder) in the old spot. This is done because it's set up to save space. Most people would be using this to move large files from games to a hard drive, off of their smaller SSD drives, to save space. Therefore it probably does the junction like I did, but just backwards. It actually moves the files then creates the "fake folder" in the original spot. This can be useful though, as you now know that if you use SteamMover to move a folder from 1 drive to another, it will actually free up space on the 1st drive, and take up more space on the 2nd drive.

As far as programs go, it doesn't matter which way the process is done or the real location of the files. Programs will see the files in either place. The files will appear to have the same size and everything. You can edit/delete/copy the same file from either place.

I know you can't download, but it's good to know that there are other junction programs out there:
https://www.freewarefiles.com/Junction-Link-Magic_program_3435.html
I quickly tested this one. It doesn't move the actual folder first. It just creates a junction.
test.png
 
Feb 22, 2018
55
0
130

So i suppose that in order to clean the files without removing the symlink I have to delete the ones inside the new location, right? What will it happen if I do the opposite?

Still the thing that confuses me is that with the screen i linked, when that person right clicked the folder, in the adress it was showing the new folder location, which doesn't happen to me, if i right click the folder in the new location the adress says it's there, same thing if I do it inside appdata.

Yes i think that's what happens but since my knowledge is limited i could only make some guesses.

So any place is fine but what happens for example if i delete the one from the original folder (wich now became a fake folder)? Will it delete the file in both locations and will it break the symlink if i do that?

Seems like that program is good thanks for letting me know, hopefully i'll have a connection one day or another.

Also sorry again for taking this much time to answer.
 

gardenman

Splendid
Moderator

I've did a little more studying on this and the reason [that guys image] looks different is because he's using a different type of link. I said above there can be different types of links. Windows comes with a built in command line program called MKLINK. Open a command prompt and type mklink and press enter and it will give you help on how to use it.

In this screen shot, I used the /D parameter and created a "Symbolic Link", not a "Junction". Notice the properties on the C:\temp link.
1.jpg


In this screen shot, I used the /J parameter and created a "Junction". Notice the properties on the C:\temp2 link.
2.jpg


They both work pretty much the same, but I'm sure there are differences. You can access the same files from either location for the links or the real folder. I don't know the differences between the symbolic links and junctions, you would have to look that up.

Deleting a file from the fake folder will also delete it from the real folder. That was previously explained. There's only one file. It's just the folders both point to the same area on the hard drive. Both folders allow you to access the same files (of which there are only 1 copy of).