TrainzUtil reference - useful if your Content Manager's not working in TS2009 SP4+

shaneturner12

Tutorial Creator
Moderators - if this is in the wrong place, please put it in the right place.

Hi Trainzers,

Below is a reference to the most useful TrainzUtil commands in TS2009 SP4, TS2010, and TS12. Certain commands in this list may also work in earlier versions, but this is not guaranteed.

For those who do not know how to access the required Windows feature, see the bottom of this post. Items in <> are where you need to enter information.

Useful TrainzUtil Commands

To use these commands, you will need to be in the folder that contains TrainzUtil - before starting, read the information at the bottom. I have personally found that using \ rather than / in the paths works better.

For entries that require a KUID, the KUID needs to be entered without the <> marks.

Note - in TS2009 SP4 and later, these TrainzUtil commands will trigger a TADDaemon process. Wait a few minutes before closing down your system.

Trainzutil installCDP <full path and filename of .cdp file> - This will install (and commit by default) a CDP file. Be aware that if the path or filename to the .CDP contains spaces, the entry must be entered in quotes.

Trainzutil installfrompath <full path for content> - This will install content from a given folder (not including CDP files - the folder needs to contain the config.txt/config.chump and other related asset files). It comes in useful to install non-CDP content from an earlier version.

Trainzutil installfromdls <KUID> - This will install content directly from the Download Station, but will not include dependencies.

Trainzutil edit <KUID> - This will open an asset for edit.

Trainzutil printconfig <KUID> - This can be used to display a config.txt file in the Command Prompt window. If > <path and filename including .txt> is added, it will write it to a text file.

Trainzutil backupkeywords or Trainzutil importkeywords - these are fairly self-explanatory. They perform the Back Up Keywords or Import Keywords features that are in Content Manager.

Trainzutil commit <kuid> - This is used to commit an asset.

Trainzutil revert <kuid> - This is used to revert an asset.

Trainzutil delete <kuid> - This is used to delete an asset. Be aware that assets deleted using TrainzUtil may become irrecoverable.

Trainzutil generatecdp <full path and filename for CDP> <kuid list> - This is used to generate a CDP file from the KUIDs mentioned in the KUID list. The KUIDS need to be entered with a space between each KUID.

Trainzutil repairdatabase - This is used to perform a command-line database repair. This can be used if a database fault is preventing Trainz from loading correctly.

These are the main entries, but there are others - use trainzutil help to find these out.

How do I gain access to these?

You will need to open Command Prompt first. To do this:

Windows XP and earlier
1.Click Start, then Run.
2.Type in 'cmd' (Windows XP) or 'command' (earlier versions), then click OK.
(note: you need to be running as an admin user to do this)
Windows Vista/7
1.Click Start, then type 'command prompt' in the search box.
2.You should get 1 result: Command Prompt. Right-click this and click Run as administrator, then click Continue or Yes when prompted.

Once you have loaded Command Prompt, enter the following command then press enter:

cd <trainz install folder>\bin

If your Trainz path contains spaces, use this:

cd "<trainz install folder>\bin"

Replace <trainz install folder> with your actual Trainz install location, including the drive letter.

Once this is done, you can then use the TrainzUtil commands given above.

Comments/Questions?

If you have any questions/comments, feel free to post a reply. I can include further information if needed.

Bear in mind that a certain amount of knowledge in how to run programs etc. is required.

Shane
 
Last edited:
Shane,

This is an awesome post and should be made into a sticky.

I have used the Trainzutil repairdatabase in a command batch file to repair my database on many occasions. This works for those times when Content Manager won't start at all.

Using an Administrator-enabled command prompt, I run the following:

d:\auran\ts12\bin\trainzutil repairdatabase

Just substitute the path location where Trainz is installed. Just remember to use quotes if it is located in the default location like this:

"C:\Program Files (x86)\Auran\TS12\bin\"trainzutil repairdatabase

This will start up the repair process and when the command prompt returns, the process is done. If you have the show database processes windows enabled, you can see the process being carried out in a window with the steps being shown and how long each one took to complete.

John
 
Last edited:
Thankyou for the comments John. One small correction I will make is when the Trainzutil path is in quotes is not to include the part after trainzutil in quotes apart from where mentioned above.

Shane
 
Thank you for making the correction. I will fix mine here myself. It looks like I typoed this as I typed it.

John
 
No problem - I had to make a correction myself. For reference though, the quote mark in your example goes between the word trainzutil and the repairdatabase part.

Shane
 
Welcome to the forums.

Your install location will be the folder you installed Trainz to. Without this information, you will not be able to follow any of the advice in this thread.

Shane
 
I have a folder full of kuids in my drive G . The path : G:\Program files (x86)\kuid . My TS2010 installation folder is on drive I . The path : I:\Program Files (x86)\Auran\TS2010 . I want to copy the kuids into the game without the CM .
 
If they are .CDP files, you need to use InstallCDP. If it's folders with config.txt files in there, use installfrompath.

Shane
 
The details are in the first post, and depends on both the path where you have Trainz installed and where the content is.

If you can tell me the exact paths for both, I should be able to assist on that front.

Shane
 
The details are in the first post, and depends on both the path where you have Trainz installed and where the content is.

If you can tell me the exact paths for both, I should be able to assist on that front.

Shane

As i wrote :


G:\Program files (x86)\kuid ( a folder with full of kuids )
I:\Program Files (x86)\Auran\TS2010 ( TS2010 installation folder )
 
OK - type the following lines into Command Prompt, pressing Enter after each line (where quote marks are included, include them):

I:
cd "I:\Program Files\Auran\TS2010"
cd Bin
trainzutil installfrompath "G:\Program Files (x86)\kuid"

Once these commands are entered, a TADDaemon process will launch to install the KUIDs. One thing to watch out for though - depending on your settings, it may or may not commit the items.

Shane
 
OK - type the following lines into Command Prompt, pressing Enter after each line (where quote marks are included, include them):

I:
cd "I:\Program Files\Auran\TS2010"
cd Bin
trainzutil installfrompath "G:\Program Files (x86)\kuid"

Once these commands are entered, a TADDaemon process will launch to install the KUIDs. One thing to watch out for though - depending on your settings, it may or may not commit the items.

Shane
Hmm.

" the system can not find the path specified "

" <trainzutil> the specified name is not recognized as an internal or external command, operable program or batch file "
 
Back
Top