NeroCMD SubDirectory


I to select a directory on a CD (or create one). Where I’ll put the selected file’s.

I whant to create or add file’s to an ISO-CD. If seen that CreateIsoTree() containes some function to use a SubDir. But it isn’t clear to me how to use this.


Can you please rephrase your question? It is not very clear what is it that you are trying to achieve.

I wish to select some file, and put them in a subdirectory on a CD. For example:


in subdirectory D:\Text\

Where D is my CD writer.

I wise to extend the NeroCmd with option --sub “Text”, so it will create a Directory Text (if it doesn’t already exists) and put all files into that directory.

Sorry for my unclearness, I hope this is clear enough.

If I look at the function CreateIsoTree, I think if have to make my adjustment there. But maybe someone has already done this, or can give me a little hand. I think I have to create a NERO_ISO_ITEM as a subdirectory class?

Yes, it is much clearer now… You should actually take a look at GetIsoTrack in IsoTrack.cpp. After the import related if statement and before the for loop you should create a set of NERO_ISO_ITEMs tied to each other and as many of them as there are subdirs in your –sub parameter. If you want to support only one directory, then things get simpler.

For instance, if you specify –sub dir1/dir2/dir3, you should create 3 NERO_ISO_ITEMs and connect them as appropriate so that they form a tree. If you want to be extra careful, you may check if any of these entries already exist in the previously imported session (if any).

Once you have done all this, you should make sure that the CreateIsoItem in the for loop below appends its findings to the end of your tree hierarchy, not the root.

Thank Alex,

It works just fine. It’s a little jugling with some records, and don’t forget to close the session.

Can you please post the final code?


Here is the most importend part: IsoTrack.cpp GetIsoTrack()

for (int i = 0; i < params.GetFileListSize(); i ++)
    NERO_ISO_ITEM* pLast;

	// Create a tree from the filename supplied.
    if(params.GetSubDir()) {
      pItem = NeroBuildIsoTreeFromPath(params.GetSubDirPath());
      //code = CreateIsoTree (params, params.GetFileList().vect[i], &pItem->nextItem );
      pLast = pItem;
      while( pLast->subDirFirstItem != NULL ) {
        pLast = pLast->subDirFirstItem;
      code = CreateIsoTree (params, params.GetFileList().vect[i], &pLast->subDirFirstItem );
    else {
	  code = CreateIsoTree (params, params.GetFileList().vect[i], &pItem );

	// If there was a problem creating the tree then delete 
	// the whole tree that has been created so far and
	// return the error code.

	if (code != EXITCODE_OK)
		DeleteIsoItemTree (*ppItem);
		return code;

	// Merge the new track with the existing one. The user could
	// specify similar paths/content on the command line. We must make
	// sure the duplicates are weeded out. If return value is false,
	// we need to quit.
	if (!MergeIsoTrack (params, ppItem, pItem))

And you need to add a function to Get and Set SubDir in the params!