You are here

Audacity temp folder location

6 posts / 0 new
Last post
Thinkpad
Thinkpad's picture
Offline
Last seen: 5 hours 50 min ago
Joined: 2008-07-03 00:33
Audacity temp folder location

I wanna change the temp folder to a directory on my D drive yet when I restart the program it has reverted to using C drive User/appdata. How do I fix this? I tried changing it in the settings and config files and made them readonly then the program wouldn't start. Please help

depp.jones
Offline
Last seen: 5 hours 6 min ago
DeveloperTranslator
Joined: 2010-06-05 17:19
It's handled by the PA.c Launcher

To change that handling, you can edit the AudacityPortable.ini
(located in the folder [your PortableApps-Directory]\AudacityPortable\App\AppInfo\Launcher\).

Look for:

[FileWrite2]
Type=INI
File=%PAL:DataDir%\settings\AudacityPortableSettings.ini
Section=AudacityInternalPaths
Key=TempDir
Value=%TEMP:DoubleBackslash%

Change Value= to the directory on your D drive (that would kind of hard code it and revert any changes you make in audacity itself).
Or simply comment that section out. Should look like that:

;[FileWrite2]
;Type=INI
;File=%PAL:DataDir%\settings\AudacityPortableSettings.ini
;Section=AudacityInternalPaths
;Key=TempDir
;Value=%TEMP:DoubleBackslash%

That would remove the PA.c Launcher's handling of the temp folder, keep that in mind, if you copy your AudacityPortable Folder to a pendrive to use it portably.
(I'm not completly shure, if the Launcher handles the step in FileWrite1 to FileWrite3 genrously, if you comment that section out. Maybe you have to adapt the remaining FileWriteNs)

-edit-
Maybe there's a simpler, but more radical solution: If It's not just AudacityPortable, but all other Application you use, you can simply change the systemwide TEMP settings ([WIN-KEY]+[Break] -> Advanced System Settings -> Advanced -> Enviroment Variables...).
Be careful not to assign a nonexistend directory (e.g. removable drive that is not present the whole time).

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 week 4 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
Commenting FileWrite

If a FileWrite section gets commented out, it is necessary to re-number the remaining sections.

depp.jones
Offline
Last seen: 5 hours 6 min ago
DeveloperTranslator
Joined: 2010-06-05 17:19
Thanks for clarification.

Thanks for clarification.
(Actually, I was too lazy to check that myself... Biggrin )

Thinkpad
Thinkpad's picture
Offline
Last seen: 5 hours 50 min ago
Joined: 2008-07-03 00:33
Thanks

I use portable apps cause I don't want things written to my registry, so using it with a pendrive doesn't apply to me. Thanks

Abraxian
Offline
Last seen: 12 hours 6 min ago
Joined: 2010-08-18 10:40
Test this for Re-Directing Temp Files to Location of Your Choice

Thinkpad,

I don't use Audacity but I do see what your problem is with Audacity and files written into the system TEMP and TMP folders. Years ago I had the same kind of issue with Firefox Portable still writing some files into locations in the system TEMP folder. Then I found this thread on mozillaZine forums: [SOLVED] Force Folder "mozilla-temp-files" to a Ramdisk?

If you have a spare half-hour it might be worth your while to read through that thread and pay particular attention to what is being said about launching programs via a batch file where the batch file sets the location of the TEMP and TMP directories for the particular program being launched via the batch file. Nowadays I use that information for several programs, portable and non-portable on system, to force them to write their temp files into a ramdisk. Beauty of it is that the re-direction is only in force for the program that is launched by the batch file - though the redirection also applies to any child process that the program might also launch.

So, let's say for Firefox Portable, I use the following batch code to force Firefox to write TEMP/TMP files into the ramdisk location:


REM Create the folders you want temp files to be written into. If the
REM folders already exist it won't be a problem for the batch file.
mkdir W:\TEMP
mkdir W:\TMP
REM Now set the system paths to use those locations for temp files.
set TEMP=W:\TEMP
set TMP=W:\TMP
REM The above paths will now be used for temp files for the program below
REM (and any child process it also launches). Those paths only apply to that program,
REM and its child processes, launched by the batch. Those are not paths applied
REM system-wide.
start "" "E:\PORTABLES\Firefox [PortApps]\FirefoxPortable.exe"
exit

So once I have the batch file constructed I just make a shortcut to the batch file and always launch Firefox Portable via that shortcut (which launches the batch file, which then runs the code). Note that I am launching the proper Firefox Portable launcher file - i.e. "FirefoxPortable.exe" - the "firefox.exe" that the portable launcher then launches gets the location of the TEMP/TMP folders passed to it by the system because it is considered a child process of the ""FirefoxPortable.exe" launcher. (Hope that makes sense.)

Test that with Audacity and see if it works for you. Just adjust the paths to suit your own system and the program you want to launch. And remember to always have the batch launch the appropriate PortableApps launcher exe file - never launch the program's proper exe file directly yourself.

Use Portable Apps on both Flash Drive and HDD/SSD.

Log in or register to post comments