上一主题: 检索 CIM 对象下一主题: 使用交互模式


调用 AutoShell

通过使用以下命令,您可以从命令行接口调用 AutoShell:

caaipaomautoshell.exe [-U username] [-P password] [-h host] [[-f] scriptfile] [scriptargs]] [-e expr] [-i]
-U username

指定有效的 CA Server Automation 用户。 您还可以使用 CAASUSER 环境变量来设置用户名。

-P password

指定该用户的密码 您还可以使用 CAASPASS 环境变量来设置密码。

-f scriptfile [scriptargs]

(可选)使用可选的脚本参数加载指定的脚本文件。 此参数可以多次使用。

-e expr

(可选)评估指定的表达式。

-i

(可选)在加载脚本之后进入交互模式。

-locale=locale

(可选)指定 IS0 639_3166 组合(例如:法语为 fr_FR)以覆盖默认的英语输出。 要使用命令提示符的区域设置,请指定“native”。

示例

运行 hello.js 脚本:

caaipaomautoshell.exe -U vaimuser -P topsecret -f hello.js

计算 4*3 的值:

caaipaomautoshell.exe -U vaimuser -P topsecret -e 4*3

为用户名和密码设置环境变量并且计算 sin(PI/2) 的值:

set CAASUSER=vaimuser
set CAASPASS=topsecret
caaipaomautoshell.exe -e Math.sin(Math.PI/2)

详细信息

有效 AutoShell 用户

使用交互模式

使用远程交互模式

批处理模式

远程批处理模式