基本自訂 > Windchill Customization Basics > Windchill Utilities > About the windchill Command
  
About the windchill Command
PTC has provided a command, windchill, to invoke Windchill actions. For example, the command can be used to stop and start Windchill, check the status of the Windchill server, and create a new shell and set the environment variables. It can also be used as a Java wrapper. In that regard, it can accept a Class file as an argument, just like Java, and execute it without a predefined environment (Windchill classes in CLASSPATH, Java in PATH, and so on).
The windchill command should be used to execute any server-side Windchill Java code. This will ensure that the environment that the command is executed in is properly setup. The environment that actions are executed within, including the windchill shell action, is defined by the wt.env properties in the wt.properties file. For example, the wt.env.CLASSPATH property will set the CLASSPATH environment variable for the action that is being invoked.
The windchill command is a Perl script that has also been compiled into a Windows binary executable. For UNIX systems, Perl 5.0 or greater must be installed. The windchill script assumes that Perl is installed in the standard install location of /usr/bin/perl. If Perl is not installed at this location, you can either create a symbolic link (recommended method) to the Perl install location or edit the windchill script to reference the Perl install location. To modify the windchill script, edit the <Windchill>/bin/windchill file. Locate the #! entry (for example, #!/usr/bin/perl -w) and change the Perl directory to the location where Perl is installed.
The windchill command is located in the <Windchill>/bin directory. If you receive a command not found message when you execute the windchill command, add the <Windchill>/bin directory to your PATH environment variable. The syntax of the windchill command is:
windchill [args] action
You can display the help for the windchill command by executing windchill with the -h argument or with no argument.
The following tables list some of the arguments and actions applicable to the windchill command. To see a complete list of the arguments, use the report generated from the help (argument).
windchill Arguments
Arguments (optional)
Description
-h, --help
Displays help and exits.
-v, --[no]verbose
Explains what is being done when a command is executed. Default is:
-- noverbose
-w, --wthome=DIR
Sets the Windchill home directory. Default is the parent directory containing the windchill script.
* 
On UNIX systems where you have multiple instances of Windchill installed under the same user account, settings made to WT_HOME and SQLPATH environment variables by using this -w option are overridden by any settings to these same variables in the user's .cshrc, .login, and .profile shell initialization files.
--java=JAVA_EXE
The Java executable. Default is the wt.java.cmd variable value specified in the $WT_HOME/codebase/wt.properties file.
-cp,
--classpath=PATH
Java classpath. Default is the wt.java.classpath variable value specified in the $WT_HOME/codebase/wt.properties file.
--javaargs=JAVAARGS
Java command line arguments.
windchill Actions
Action
Description
shell
Sets up a Windchill environment in a new instance of the currently running shell.
start
Starts the Windchill server.
stop
Stops the Windchill server.
status
Retrieves the status of the Windchill server.
version
Displays the Windchill installation version.
properties <resource>
[,...][?key[&key2]...]
Displays the properties as seen by Windchill for the given resource with substitution and other actions executed. It can be limited to a given set of keys.
For example:
windchill properties wt.properties – lists all wt.properties
windchill properties wt.properties?wt.server.codebase – lists server codebase
windchill properties wt.properties?wt.env.* – lists all the environment variables use by windchill shell
windchill properties – generates the help report with no arguments
CLASS [CLASS_ARGS]
Run a Windchill class with optional class arguments. For example:
windchill wt.load.Developer -UAOps
Windchill Utilities