cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Deleting temp files to free up disc space?

cedroneg
6-Contributor

Deleting temp files to free up disc space?

Hello,

 

I am trying to free up some disc space on my PC and am trying to figure out if I am able to delete any of the files within the Temp folder on my C drive. There are a number of .cab files that I can not really find out what they are for. Am I able to delete those without causing any issues or is there anything else I can delete to free up space? Any help would be appreciated, thank you.

 

 

11 REPLIES 11

Most of the Creo related files are  trail.txt, .log, .dat, std.err, std.out, .lst, .acl, .crc, you may delete these files. About .cab files under temp directory, I think from temp directory there should not be any impact of deleting these. It's always better to have a backup 🙂

If you're running out of space on the hard drive you use to store Creo files, you might be suffering from version retention. By default, every time you save a file in Creo, it increments the number at the end of the file name and saves a new file, while retaining the last number. For example "part.prt.12" is saved as "part.prt.13". We've had times where someone was working on a large assembly and had hundreds of versions of each part, to the point where a directory that should have had about 300MB of data files was using 16GB of space.

There's a utility program, "purge.exe" that is included with Creo that will delete all but the most recent version of the parts, assemblies, etc. in a directory. Keeping old versions is often useful when things are in development, so you can recover if you make some sort of horrible mistake, but once the design is done it's always our practice to clean up the old stuff so massive amounts of space aren't wasted.

I've got a batch file "recpurge.bat" that I use to recursively traverse the directory structure on our server to clean up all the old versions and get rid of the temp files Creo creates. If you're interested I can post the contents of the file.

Ciao puoi postare quel contentuto del file.bat mi interesserebbe grazie mille 

Okay, here it is.

::
:: Date   * 2019-10-17
:: Author * Kenneth J. Farley
::
:: Recursively traverses the directory structure, starting at the current
:: directory, and executes a purge and any other commands necessary. The
:: pseudocode for this is as follows
::
:: (1) Generate a list of directories
:: (2) For each of the directories
::     a. change to that directory, via a "pushd"
::     b. Execute the desired commands
::     c. change back to the original directory, via "popd"
::

@echo off
for /r /d %%d in ("*") do call :doPurge "%%d"
exit /b

::
:: This code is executed for each directory visited. The primary purpose is to
:: run the "purge" command, but it's also helpful to get rid of any other stray
:: files that Pro/E creates in the normal course of operation.
::
:: Note: The "2> nul" construct is used to throw away any "file not found" type
::       errors generated when the delete command doesn't find the target files
::       provided to it.
::

:doPurge
pushd %1
echo Processing %1
c:\ptc\purge
::
:: Windows generated files
::
del /ah Thumbs.db 2> nul
::
:: PTC General files
::
del current_session.pro 2> nul
del datafile.ers 2> nul
del errors.lst.* 2> nul
del fix_params.log 2> nul
del *.acc 2> nul
del *.crc 2> nul
del *.err.* 2> nul
del *.idx 2> nul
del *.log.* 2> nul
del std.err 2> nul
del std.out 2> nul
del trail.txt.* 2> nul
del *.xpr 2> nul
del *.tst 2> nul
::
:: PTC Manufacturing files
::
del *.acl 2> nul
del *.lst 2> nul
del *.mbx 2> nul
del *.ncl.* 2> nul
del *.ncl_a.tab 2> nul
del *.ncl_b.tab 2> nul
del *.ncl_c.tab 2> nul
del *.ncl_x.tab 2> nul
del *.ncl_y.tab 2> nul
del *.ncl_z.tab 2> nul
del *.tap 2> nul
popd
exit /b

To use this, just copy the contents into a text file with a .bat extension (I call it recpurge.bat). Copy the file to the top level directory (folder), then run it in a command window. It's not a very complicated script, but it works fine for me. The trickiest part is figuring out where the "purge.exe" program is on your system. I copied it to C:\ptc on my system.

ho trovato il file pure.exe Grazie mille Buona giornata !

 

The file you are showing is not a .exe file. Those are binary executables that are not "readable" by humans.

What you have is probably the "purge.bat" file. This should work for you, too. For me, this file is in

 

C:\Program Files\PTC\Creo 4.0\M120\Parametric\bin

 

The exact location of this file will depend on your version and build of Creo.

Here's a new version of the batch file that uses the purge.bat file instead of the old purge.exe I've had for decades.

::
:: Date   * 2020-08-21
:: Author * Kenneth J. Farley
::
:: Recursively traverses the directory structure, starting at the current
:: directory, and executes a purge and any other commands necessary. The
:: pseudocode for this is as follows
::
:: (1) Do a query to get the space available on the current disk.
:: (2) Generate a list of directories
:: (3) For each of the directories
::     a. change to that directory, via a "pushd"
::     b. Execute the desired commands
::     c. change back to the original directory, via "popd"
:: (4) Do a query to get the space available on the current disk.
:: (5) Calculate the space recovered and output the value.
::

@echo off
set drvNow=%cd:~0,2%
for /f "usebackq delims== tokens=2" %%x in (`wmic logicaldisk where "DeviceID='%drvNow%'" get FreeSpace /format:value`) do set FreeBefore=%%x
set FreeBefore=%FreeBefore:~0,-6%
for /r /d %%d in ("*") do call :doPurge "%%d"
for /f "usebackq delims== tokens=2" %%x in (`wmic logicaldisk where "DeviceID='%drvNow%'" get FreeSpace /format:value`) do set FreeAfter=%%x
set FreeAfter=%FreeAfter:~0,-6%
set /A bytesRecovered=%FreeAfter%-%FreeBefore%
echo.
echo Space Recovered = %bytesRecovered% Mb
echo.
exit /b

::
:: This code is executed for each directory visited. The primary purpose is to
:: run the "purge" command, but it's also helpful to get rid of any other stray
:: files that Pro/E creates in the normal course of operation.
::
:: Note: The "2> nul" construct is used to throw away any "file not found" type
::       errors generated when the delete command doesn't find the target files
::       provided to it.
::

:doPurge
pushd %1
echo Processing %1
call "C:\Program Files\PTC\Creo 4.0\M120\Parametric\bin\purge.bat"

::c:\ptc\purge
::
:: Windows generated files
::
del /ah Thumbs.db 2> nul
::
:: PTC General files
::
del current_session.pro 2> nul
del datafile.ers 2> nul
del errors.lst.* 2> nul
del fix_params.log 2> nul
del *.acc 2> nul
del *.crc 2> nul
del *.err.* 2> nul
del *.idx 2> nul
del *.log.* 2> nul
del std.err 2> nul
del std.out 2> nul
del trail.txt.* 2> nul
del *.xpr 2> nul
del *.tst 2> nul
::
:: PTC Manufacturing files
::
del *.acl 2> nul
del *.lst 2> nul
del *.mbx 2> nul
del *.ncl.* 2> nul
del *.ncl_a.tab 2> nul
del *.ncl_b.tab 2> nul
del *.ncl_c.tab 2> nul
del *.ncl_x.tab 2> nul
del *.ncl_y.tab 2> nul
del *.ncl_z.tab 2> nul
del *.tap 2> nul
popd
exit /b

This new version also tells you how much space was cleaned up when it is done. I forgot I'd added that in a more recent improvement.

For you to use it, change the call "C:\Program..." line to call the purge.bat file on your system. Don't forget to enclose the full directory specification of the purge.bat in quotes.

Funziona correttamente ho tutto quello che mi serve ma se volessi che il purge togliesse anche i file tipo .tool o .tmp o .tph ? ce un modo per farlo ?

Look at the batch file code. I am already doing "cleaning" to remove other files that Creo creates. All of the "del ...." commands that are after the purge command are getting rid of file types that should be temporary but get left behind by Creo. You can add more, like

del *.tmp 2> nul

You just have to be really careful you don't delete anything you might want later.

Ci avevo già provato e non ci ero riuscito perché volevo eliminasse il file completamente ma dovevo scrivere 

del *.tmp * 2> nul

con l'asterisco alla fine per cancellare il file e non solo la versione.

Ti ringrazio infinitamente. Questo comando è fondamentale !

 

I hope you meant *.tmp.* (with a "dot" before the second *). Using just * will attempt to delete everything, but will ask if you are sure before doing it.

No no i tmp non mi servono le versioni va benissimo che le cancelli tutte quindi senza il punto era ciò che cercavo. Grazie ancora per tutto !!!

Top Tags