Start .bat file from script

DraagonStormDraagonStorm Posts: 748

How would I start a batch file (.bat) from DAZ script and then let the script end while the .bat file continues.

Comments

  • TugpsxTugpsx Posts: 734
    edited November 2013

    Are you trying to use the script to write the batch file then launch it or does the batch file already exist?

    If you are building the batch try something along this line

    var file = new DzFile( batFilename );
    file.open( file.WriteOnly )
    file.writeLine( buildCommandLine( true, batchPath, "" ) )
    file.close()

    Use this to launch it

    var str = buildCommandLine( false, batchPath, "" )
    // debug( str ); // show results of batch file creation
    new DzProcess( str ).start();

    Post edited by Tugpsx on
  • TugpsxTugpsx Posts: 734
    edited December 1969

    Keep in mind there is a lot involved in launching an external file.
    the basic is as follows
    define file location
    define file name and extension if needed
    add arguments to file if needed
    call launch process to start file
    if file fails to load have error report

  • DraagonStormDraagonStorm Posts: 748
    edited December 1969

    I'll be creating the batch file. Thank You, I'll give this a try.

Sign In or Register to comment.