Export (0) Print
Expand All

SMS_Program

System Center

The SMS_Program WMI class describes a program or command to run when software is distributed to a client computer. Programs are always associated with a parent package, and typically represent the installation program for the package.

The following syntax is simplified from MOF code and includes all inherited properties.

Class SMS_Program : SMS_BaseClass
{
  uint32 ActionInProgress;
  string ApplicationHierarchy;
  string CommandLine;
  string Comment;
  string DependentProgram;
  string Description;
  string DiskSpaceReq;
  string DriveLetter;
  uint32 Duration;
  uint8 Icon[];
  uint32 IconSize;
  string PackageID;
  uint32 ProgramFlags;
  string ProgramName;
  string RemovalKey;
  string Requirements;
  SMS_OS_Details SupportedOperatingSystems[];
  string WorkingDirectory;
};

Properties

ActionInProgress
Data type: uint32
Access type: Read-only

Current action being performed on the program by SMS. Use this property in your WHERE clause to filter out programs that have been marked for deletion, but have not yet been deleted. For details, see Remarks.

This property was added in SMS 2.0, Service Pack 1.

Values are:
DELETE (3)

ApplicationHierarchy
Data type: string
Access type: Read/write

Reserved.

CommandLine
Data type: string
Access type: Read/write

Required. Command to execute when the program is launched.

Comment
Data type: string
Access type: Read/write

Description of the program displayed in the SMS console.

DependentProgram
Data type: string
Access type: Read/write

Formatted text string defining any program that should be run prior to execution of the this program. The format is defined as: <PackageID>;;<ProgramName>. If the program is in the same package, you can simply specify ;;<ProgramName>.

Note that the dependency is maintained only for the first execution of the program. After the program has run, the dependency is ignored. For example, you cannot create a recurring scheduled job where the dependency is maintained for each execution of the program.

Description
Data type: string
Access type: Read/write

Description of the program (not displayed in the console).

DiskSpaceReq
Data type: string
Access type: Read/write

Approximate disk space the program requires. Used in the console and advertisement to alert the user as to the program's disk space requirements, The user can then decide to accept the advertisement or perform some disk management task first.

The format is: "<size> <KB|MB|GB>".

DriveLetter
Data type: string
Access type: Read/write

Drive letter (one character in the range a-z) the program maps to and runs from when it is executed.

Duration
Data type: uint32
Access type: Read/write

Approximate time, in minutes, that the program executes. Used in the console and advertisement to alert the user as to the time requirements. The user can then decide to accept the advertisement or postpone the installation until time permits.

Icon
Data type: uint8[]
Access type: Read/write

Icon to associate with the program. The icon is displayed in the console.

IconSize
Data type: uint32
Access type: Read-only
Qualifiers: Lazy

Size of the icon (bytes).

PackageID
Data type: string
Access type: Read/write
Qualifiers: Key

Existing package (this value must come from an existing package) with which to associate this program. More than one program can be associated with the same package. You cannot change this value after the instance is created. To associate this program with a different package, you must delete the instance and create a new instance with the new PackageID value.

ProgramFlags
Data type: uint32
Access type: Read/write
Qualifiers: Bits

Defines the installation characteristics of the program, such as whether this is an unattended install, the install reboots the computer, or the install runs in a minimized window. Note: The default flags are USERCONTEXT, USEUNCPATH, and ANY_PLATFORM.

Bit flags Description
DISABLED (bit 12) Program has been disabled.
UNATTENDED (bit 13) User input is not required to run.
USERCONTEXT (bit 14) User must be logged in for the program to run.
ADMINRIGHTS (bit 15) Program must be run as the local Administrator account.
EVERYUSER (bit 16) Program is offered to each new user that logs in. If this bit is not set, the program is offered only to the first user that logs in.

This bit has meaning only when USERCONTEXT is set.

NOUSERLOGGEDIN (bit 17) User must not be logged in when program runs.
OKTOQUIT (bit 18) Program restarts the computer itself when it is finished running.
OKTOREBOOT (bit 19) SMS restarts the computer when the program has finished running.
USEUNCPATH (bit 20) Use a UNC path (no drive letter) to access the distribution point.
PERSISTCONNECTION (bit 21) Persists the connection to the drive specified in the DriveLetter property. The USEUNCPATH bit flag must not be set.
RUNMINIMIZED (bit 22) Run the program as a minimized window.
RUNMAXIMIZED (bit 23) Run the program as a maximized window.
HIDEWINDOW (bit 24) Hide the program's window.
OKLOGOFF (bit 25) SMS logs the user off when the program has finished running.
RUNACCOUNT (bit 26) Program runs using the SMS Windows NT Client Software Installation Account. This account is used for unattended installs and requires the UNATTENDED bit to be set. For details on this account, see the SMS Administrator's Guide. You can specify this account in the console or programmatically using the site control file.
ANY_PLATFORM (bit 27) Program runs on any platform; ignore supported OS field.
STILL_RUNNING (bit 28) Notifies the user if the program exceeds the Duration time by more than 15 minutes.
SUPPORT_UNINSTALL (bit 29) Remove the program from the client when it is no longer advertised. If you set this bit, you must specify a value for RemovalKey.

ProgramName
Data type: string
Access type: Read/write
Qualifiers: Key

Required. Unique name that represents this program.

RemovalKey
Data type: string
Access type: Read/write

Registry key that identifies the uninstall script for this program. The script must reside in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall registry path.

Requirements
Data type: string
Access type: Read/write

Description of any additional requirements of the program.

SupportedOperatingSystems
Data type: SMS_OS_Details[]
Access type: Read/write
Qualifiers: Lazy

Describes the platforms on which the program can run.

If you do not specify ANY_PLATFORM in the ProgramFlags property, you must specify one or more supported operating system objects. SMS_SupportedPlatforms contains the list of platforms that SMS supports. SMS 2.0 does not support the Macintosh platform. You must specify ANY_PLATFORM in the ProgramFlags property and have the package distributed by an SMS 1.2 site.

WorkingDirectory
Data type: string
Access type: Read/write

Defines the location from which the program executes. This can be an absolute path on the client, or a path relative to the distribution point folder that contains the package.

If you do not specify a working directory, SMS uses the specified or default distribution point folder.

Remarks

When you delete an instance of SMS_Program, the instance is not deleted until its related components, such as its advertisements, are deleted. Instead, SMS sets the ActionInProgress property to 3 (delete) to let you know that the program is marked for deletion. To ensure that your query does not return programs that have been deleted (marked for deletion), you should add this case to your WHERE clause.

See Also

Creating a Package and Programs Using SMS Classes, SMS_OS_Details, SMS_Package, SMS_PDF_Package, SMS_PDF_Program, Software Distribution Classes

Show:
© 2015 Microsoft