Next Topic

Previous Topic

Book Contents

executeFile()

Executes the specified file on the managed machine. This function replicates launching an application using the Run… command located in the Microsoft Windows Start menu. This function takes three parameters:

Note: Environment variables are acceptable, if they are set on a user's machine.  For example, using a path %windir%\notepad.exe, would be similar to C:\windows\notepad.exe.

If Execute as the logged on user is selected, then a credential must be specified by running either the impersonateUser() or useCredential() command before this command. If run Execute as the system account is selected, execution is restricted to the agent's system level access.

Example - Sample Procedures.Managed Services.System Mgmt.Shutdown

executeFile("%windir%\system32\shutdown.exe", "-s -f", "Execute as System and Continue", "Windows 8.1", "Halt on Fail")