Manually set the Temp folder
Manually set the Temp folder
I wish we could set a Temporary folder.
Currently, as far as I can tell, the only control we have over the Temp folder is no control, or in the Source Directory.
I wish we could put it in a specific folder. My IT guy switched me to a new antivirus, but it is a nightmare to configure. It would be a whole lot easier if I could set it to appdata\Local\PB_Tests, or something like that. The way it is now, using a shared Temp folder, makes it nearly impossible to configure.
Thanks.
Currently, as far as I can tell, the only control we have over the Temp folder is no control, or in the Source Directory.
I wish we could put it in a specific folder. My IT guy switched me to a new antivirus, but it is a nightmare to configure. It would be a whole lot easier if I could set it to appdata\Local\PB_Tests, or something like that. The way it is now, using a shared Temp folder, makes it nearly impossible to configure.
Thanks.
-
- Addict
- Posts: 4779
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Manually set the Temp folder
You can try to start PB from a batch file, where previously the temp directory is set to a location of your choice, e.g. on Windows (not tested):
//edit 2015-09-16:
Here is more comprehensive code and explanation.
Code: Select all
SET temp=C:\Users\Tenaja\AppData\Local\PB_Tests
C:\Program Files\PureBasic\PureBasic.exe %1
Here is more comprehensive code and explanation.
Last edited by Little John on Wed Sep 16, 2015 2:49 pm, edited 1 time in total.
Re: Manually set the Temp folder
Is that permanent, or only for PB?
-
- Addict
- Posts: 4779
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Manually set the Temp folder
That is only for the programs which are launched from that batch file (after the "SET temp=..." line).Tenaja wrote:Is that permanent, or only for PB?
Re: Manually set the Temp folder
I must be doing something wrong, because this will not launch the IDE, but just compile one file. That means it will not work with the debugger. Or, and I just stuck with it that way?
-
- Addict
- Posts: 4779
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Manually set the Temp folder
Works here on Windows 7 "as advertised". 
The file "PureBasic.exe" is the IDE.

The file "PureBasic.exe" is the IDE.
Re: Manually set the Temp folder
I get a dos box flash up and disappear too quickly to read. Maybe it does not work for me because I have a space in the directory. (starts with C:\Program Files (x86).) Is there an easy workaround?
Re: Manually set the Temp folder
Put double quotes around the path.
Re: Manually set the Temp folder
Little John, I appreciate your suggestion, but everything I have tried, and I cannot prevent PB from using the Windows TEMP folder. I tried it with and without quotes around the directories, and I tried it with both of those lines on the same line, as well as on separate lines (the way they pasted). Even with the "Create temporary executable in the source directory" option set, PB still creates a *.TMP file within the \Temp folder.Little John wrote:You can try to start PB from a batch file, where previously the temp directory is set to a location of your choice, e.g. on Windows (not tested):
Code: Select all
SET temp=C:\Users\Tenaja\AppData\Local\PB_Tests C:\Program Files\PureBasic\PureBasic.exe %1
The reason I need this is because my IT guy took us to a new AV, and it is not PB-friendly. (Other than PB, I prefer it over the old one; it found some malware that the old one did not find...) Unfortunately, every file the AV stops is in the AppData\Local\Temp folder, and the file extension is always *.TMP, so PB does not get to make an exe. Obviously every *.TMP file within the \Temp folder is far too generic to exclude, so I figured I would try to create a pb-specific temp folder, but that is eluding me.
I tried running PB with the \Portable switch, and even then, the AV stopped it, flagging a *.TMP file within the \Temp folder...so obviously the \Portable switch does not do what one would hope.
This was easy when I could just whitelist PureBasic_Compilation0.exe through PureBasic_Compilation9.exe, but as long as I have the debugger enabled, PB does not get past the linker.
Thanks.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Manually set the Temp folder
I think this is an urgent matter, I hope Fred can make this tiny improvement soon.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Addict
- Posts: 4779
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Manually set the Temp folder
I'm sorry that the suggestion does not work for you. As I wrote, it works as expected on my system.Tenaja wrote:Little John, I appreciate your suggestion, but everything I have tried, and I cannot prevent PB from using the Windows TEMP folder.
Then something strange seems to go on on your system. Sorry again, I've got no idea what the reason could be.Tenaja wrote:Even with the "Create temporary executable in the source directory" option set, PB still creates a *.TMP file within the \Temp folder.
I cannot recall ever having seen PB automatically create a file with extension .TMP.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Manually set the Temp folder
you can add aI get a dos box flash up and disappear too quickly to read.
Code: Select all
pause
Code: Select all
SET temp=C:\Users\Tenaja\AppData\Local\PB_Tests
C:\Program Files\PureBasic\PureBasic.exe %1
pause
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Addict
- Posts: 4779
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Manually set the Temp folder
http://www.purebasic.fr/english/viewtop ... 03#p456203IdeasVacuum wrote:..... but I'm not sure if that Batch File is setting Temp for PB or re-locating Temp for the whole system?
Re: Manually set the Temp folder
It is caught by the AV program, and the PB error message box indicates a linker error.Little John wrote:I cannot recall ever having seen PB automatically create a file with extension .TMP.