How to Package Several Projects Automatically Using CMD and Batch File


Applies To
Product(s):AutoPLANT Modeler - Project Packager
Version(s):
Environment: Windows 7/8.1/10 (64 bit)
Area: General
Subarea: 
Original Author:Kestutis Mitkus, Bentley Product Advantage Group

Background

When requirement raises to package several projects automatically, instead of going through the Project Packager Wizard for each project separately, there is possibility to use several commands in command window. In this Example a batch file will be created, which can be used to package required projects.

Steps to Accomplish

To package required project using command window, ProjectPackager.exe should be run with 6 command line parameters.

Mode

/P for packaging
/U for unpackaging

Zip File name and pathC:\Testing Projects\Test1.zip
Project RootC:\Testing Projects
Project ID0001
User nameSupervisor
PasswordSupervisor

  1. Create *.bat file with commands in it to package required AutoPLANT projects:

    pushd C:\Program Files (x86)\Bentley\Plant V8i\Bin
    ProjectPackager.exe /P "C:\Testing Projects\Test1.zip" "C:\Testing Projects" 0001 Supervisor Supervisor
    ProjectPackager.exe /P "C:\Testing Projects\Test2.zip" "C:\Testing Projects" 0002 Supervisor Supervisor
    popd

  2. Open CMD and type in batch file running command:

    C:\Testing Projects\ProjectsPackager.bat


    If path contains directories with spaces in their names, then you might get same message. In this case a short path can be used instead. To check what Short path name is for required directory open CMD, go to required directory and with dir/x command populate information about all directories

    cd C:\
    dir/x



    In this example Short path name isTESTIN~1

    C:\TESTIN~1\ProjectsPackager.bat



  3. After launching this batch file all defined projects will be packaged one by one without need of going trough Project packaging wizard.

Comments or Corrections?

Bentley's Product Advantage Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!