Changing Windows public folder in batch script.
Posted
by Angus
on Super User
See other posts from Super User
or by Angus
Published on 2009-11-13T12:17:55Z
Indexed on
2010/04/03
1:03 UTC
Read the original article
Hit count: 486
I've installed Steam on an external hard drive so I can play games on different computers by just moving the drive around. Since save games are often saved in My Documents or AppData, but I want them to move with the external hard drive, I wrote a batch file that sets environment variables before starting steam.
setocal
set USERPROFILE=%EXTERNAL_LETTER%\Profile\Me
set APPDATA=%USERPROFILE%\AppData\Roaming
...
start %TARGETAPP%
endlocal
I'm not sure if this is the right way to do this on Windows, but it seems to work.
However, one game saves its games in the Shared Documents folder. I've tried setting %PUBLIC% and %ALLUSERSPROFILE% but that does not seem to affect where the game looks. Is it possible to make this one program use a different Shared Documents folder, either by environment variables or some other means?
The change in Shared Documents should only affect the one program, I do not want it to be a permanent or system wide change to Windows.
© Super User or respective owner