Topic
  • No replies
TigerTrix
TigerTrix
18 Posts

Pinned topic BAT Files (run commandline tools & stop/start cmqs)

‏2010-06-16T04:10:06Z |
The following are good example BAT files (for Windows, DB2) that you can copy and edit to fit your system to easily do the following:

  • Stop / Start CMQS (WAS Profile)
  • Run CMQS Commandline Admin Tools

I recommend creating simple BAT or SH script files that you can put on the root or home of your file system so you can easily restart CMQS or quickly run any configuration tool without having to remember anything. These are just BAT files I use to configure once on any CMQS system so I do not have to remember which WAS profile, specific tool names, or any other locations. It really makes it easy. So if you aren't comfortable with running configuration tools, I recommend just taking a just a few minutes to easily edit for your system and use them. I created these in only 3 minutes following the the copy-paste examples from the Official Documentation. Plus they print a reminder of the tool names.

To run commandline tools, just type:
> cmqsenv
> cmqs ToolName

Just highlight this text and paste into notepad, or download the attachments. Edit the text in underlined italics to fit your system. The rest should be okay. For Oracle or Unix, check the official documentation and create script files to fit your system.

stopCMQS.bat
cd c:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\bin
stopServer server1 -username yourWasAdmin -password yourWasPw

startCMQS.bat
cd c:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\bin
startServer server1

cmqsenv.bat (1.1 FP1+)
@ECHO OFF
cls
set PATH=C:\Program Files\IBM\WebSphere\AppServer\java\bin;%PATH%
set QS_ICM=C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\node01Cell\clb.cm.websvc.ear
set CLASSPATH=%CLASSPATH%;%QS_ICM%\cmgmt;%QS_ICM%\lib\;%QS_ICM%\lib\clb.cm.model.jar;%QS_ICM%\lib\cmbsdk81.jar;%QS_ICM%\lib\commons-logging-1.0.4.jar;%QS_ICM%\lib\db2jcc.jar;%QS_ICM%\lib\db2jcc_license_cu.jar;%QS_ICM%\lib\db2jcc_license_cisuz.jar;%QS_ICM%\lib\ecm.quickr.search.jar;%QS_ICM%\lib\ilel-core.jar;%QS_ICM%\lib\ilel-sqp.jar;%QS_ICM%\lib\log4j-1.2.15.jar;%QS_ICM%\lib\lucene-core-2.3.2.jar;%QS_ICM%\lib\siapi-2.2.0.jar;%QS_ICM%\lib\wsServerStubs-8.0.5.jar;
echo == CMQS COMMANDLINE TOOLS ENV ==
echo QS_ICM=%QS_ICM%
echo.
echo Tools: Browser, LibraryCreate, LibraryDelete, ApplicationCreate, ApplicationDelete, DocumentTypeEnable, SavedSearchAdmin, PathModelCreate, PathModelDestroy
echo.
echo To Run: cmqs ToolName or java com.ibm.content.cm.tools.ToolName

cmqs.bat
java com.ibm.content.cm.tools.%1%


UPDATE 2010/09/14: Classpath Change in 1.1 FP1
As documented in the 1.1 FP1 readme (contents):
The command-line configuration to run the configuration tools has changed. If you previously created or copied scripts to set up your class path to run the configuration tools from the command line, you must update them. The library JAR file name in the class path setup has changed from wsServerStubs-8.0.5.jar to wsServerStubs-8.0.6.jar.

The BAT files in this post have been updated to reflect this change. The attached file contains both the original copy for 1.1 if you have not upgraded to 1.1 FP1 and the revised script for 1.1 FP1+. For your convenience, and old copy of the script is copied below if you still want to copy from this post instead of downloading.

Old Copy: cmqsenv.bat (1.1 initial release)
@ECHO OFF
cls
set PATH=C:\Program Files\IBM\WebSphere\AppServer\java\bin;%PATH%
set QS_ICM=C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\node01Cell\clb.cm.websvc.ear
set CLASSPATH=%CLASSPATH%;%QS_ICM%\cmgmt;%QS_ICM%\lib\;%QS_ICM%\lib\clb.cm.model.jar;%QS_ICM%\lib\cmbsdk81.jar;%QS_ICM%\lib\commons-logging-1.0.4.jar;%QS_ICM%\lib\db2jcc.jar;%QS_ICM%\lib\db2jcc_license_cu.jar;%QS_ICM%\lib\db2jcc_license_cisuz.jar;%QS_ICM%\lib\ecm.quickr.search.jar;%QS_ICM%\lib\ilel-core.jar;%QS_ICM%\lib\ilel-sqp.jar;%QS_ICM%\lib\log4j-1.2.15.jar;%QS_ICM%\lib\lucene-core-2.3.2.jar;%QS_ICM%\lib\siapi-2.2.0.jar;%QS_ICM%\lib\wsServerStubs-8.0.5.jar;
echo == CMQS COMMANDLINE TOOLS ENV ==
echo QS_ICM=%QS_ICM%
echo.
echo Tools: Browser, LibraryCreate, LibraryDelete, ApplicationCreate, ApplicationDelete, DocumentTypeEnable, SavedSearchAdmin, PathModelCreate, PathModelDestroy
echo.
echo To Run: cmqs ToolName or java com.ibm.content.cm.tools.ToolName

Attachments

Updated on 2010-09-15T01:09:58Z at 2010-09-15T01:09:58Z by TigerTrix