GP Temp files

How Can We Help?

GP Temp files

You are here:
< Back

Microsoft Dynamics GP uses three different types of temp tables or files: SQL, C-tree and Memory.  Most of the GP temp tables are C-tree Runtime Engine (Dynamics.exe), though there are some memory tables use by AIT and other ISV applications.

The SQL temp tables are not an issue with GP because SQL Server takes care of cleaning them up automatically either when the user’s connection is dropped or when GP closes the connection to a table.  At issue are the C-Tree and Memory temp tables.

C-tree temp tables are stores in the user’s temp folder.  You can locate the temp folder by typing %TEMP% in the address bar of Windows Explorer.  GP temp tables all beginning with a ‘TNT’ prefix and have a .dat, .tmp and/or .idx extensions.  Unlike the SQL temp tables, C-tree temp files are not removed by the Dynamics.exe when GP is done with them.

Memory tables were originally stored in memory, so they were very fast (since there was no disk access or network traffic required to access the data), but Microsoft had problems maintaining these files in memory.  They were turned into disk-based C-tree tables that are stored in folders underneath the users temp folder.  These folders all begin TNT.

Although these C-tree and memory file are usually small, because they are created with an 8.3 file name, you could, after years of running Dynamics GP, use up all available file names, and that would cause Dynamics to not function properly.  You could also, if you are running high volumes of transactions through TPS or GP Agent, run into this issue sooner, because each task running through the DPS is going to create temp files. If you get an Error 46, this indicates that GP can no longer create a temp file because the name already exists and cannot be reused.  The  specific table name that appears in the GP error can vary, but it will always be a temp table.

These temp files and folders should be deleted on a regular basis.  Never attempt to delete them while you are running Dynamics GP.

If you install or have Microsoft Powershell on your computer, you can use Powershell to cleanup your Dynamics GP temp files and folders.

If you are using Vista, Windows 7, 8 , Server 2008 or Server 2012:

1. Create a new text file and name it RemoveGPTemp.ps1.  “.PS1” is the default extention for Powershell command files.
2. Remember the exact location of RemoveGPTemp.ps1, because Powershell required an exact path when running a command file.  For the purposes of this example, we’re saving it in a C:\Utilities folder that we’ve created.
3. Copy and paste the following command into the RemoveGPTemp.ps1 file: get-childitem c:\users\ -include tnt*.dat, tnt*.idx, tnt*.tmp, tnt* -recurse -force | foreach ($_) {remove-item $_.fullname -force -recurse -confirm:$false}
4. Save the file.
5. Create a .cmd file with the following line: powershell C:\Utilities\RemoveGPTemp.ps1
6. Add this .cmd file to either your Start Up folder or as part of a login script.

If you are using Windows XP or Windows Server 2003:

1. Follow all the steps as above except copy and paste the following command into the RemoveGPTemp.ps1 file: get-childitem “C:\Docments and Settings\” -include tnt*.dat, tnt*.idx, tnt*.tmp, tnt* -recurse -force | foreach ($_) {remove-item $_.fullname -force -recurse -confirm:$false}

If you want to use this for the currently logged in user:

1. Use the following command: get-childitem $home -include tnt*.dat, tnt*.idx, tnt*.tmp, tnt* -recurse -force | foreach ($_) {remove-item $_.fullname -force -recurse -confirm:$false}

If you have nevery run Powershell scripts on the computer, you will likely recieve an error because, by default, Powershell will not run this type of operation without a signed publisher.  In order to allow the Powershell scripts to run, you will have to change the execution policy.  To do so, run the following script in a Powershell prompt to enable locally executed Powershell commands:

Set-ExecutionPolicy RemoteSigned

Be careful about using this on a terminal server, as it could remove files that are being used by other GP users, which would likely crash their GP session.  If you have not configured your system to run Powershell commands, you may need to enable execution of unsigned commands or you will need to add certification to the command.