NScript functionality
search cancel

NScript functionality

book

Article ID: 179744

calendar_today

Updated On: 05-13-2025

Products

IT Management Suite Client Management Suite

Issue/Introduction

What is NScript.exe and how does it work?

Environment

ITMS 8.x

Resolution

NScript is a .NET executable that comes with the Notification Server. It is located under '%InstalPath%\Notification Server\Bin' and allows you to run C# files as a script, thus avoiding the need to compile the files into .NET assemblies.

The benefits of having scripting access to the Notification Server system are:

  • The possibility of running a script for development to fix a known issue.
  • The possibility to automate console or Notification Server tasks that are not included in the ASDK (such as PMS and so on).

NScript usage:

C:\Program Files\Altiris\Notification Server\bin>NScript.exe
NScript - A .NET execution engine
=================================

Usage: NScript.exe [Flags] ScriptFileName ScriptArg1 ScriptArg2 ScriptArgN

Flags:
  -?  This help text
  -v  Verbose mode - show parameter(s), compilation status, etc

ScriptFileName:
  The name of the script file that you wish to execute. The language can be
  either C# or VisualBasic.NET. The file must contain a Main( string[] args )
  method, which is the entry point of the script file.

ScriptArg1 ScriptArg2 ScriptArgN:
  The parameters after ScriptFileName are passed to the Main( string[] args )
  method for the use of the script to do whatever it needs to do.

Press the enter key to exit.

Example:

  • Copy the NScript to the ...\Program Files\Altiris\Notification Server\bin directory
  • Execute the following command from a DOS windows (using the working directory from above): nscript.exe MyNScript.cs