Oracle APEX backups via command line/script

The APEX installation files are required. http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html

set DRIVE=F: set ORACLECLASSPATH=D:\app\product\11.2.0\client_1\jdbc\lib\ojdbc6.jar set UTILITYPATH=F:\Download\apex_4.2.2\apex\utilities set DBHOST=il02dwdev1.comm.mot.com:1521:DEDW set USER=dbuser set PWD=dbpassword set WORKSPACEID=1260432179363693 set APPID=131
 * Windows
 * 1) For Workspace backup
 * 1) For App backup

%DRIVE% cd %UTILITYPATH% set CLASSPATH=%CLASSPATH%;%ORACLECLASSPATH%;%UTILITYPATH% java oracle.apex.APEXExport -db %DBHOST% -user %USER% -password %PWD% -instance java oracle.apex.APEXExport -db %DBHOST% -user %USER% -password %PWD% -workspaceid %WORKSPACEID% java oracle.apex.APEXExport -db %DBHOST% -user %USER% -password %PWD% -applicationid %APPID%
 * 1) Backup every Apps owned by USER
 * 2) If USER is APEX_040200 or SYSTEM, this will backup EVERY apps
 * 1) Backup all Apps in a workspace
 * 1) Backup only an App