What is NScript and how does it work?

book

Article ID: 179744

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server)

Issue/Introduction

 

Resolution

Question
What is NScript.exe and how does it work?

Answer
NScript is a .NET executable that comes with Notification Server. It is located under '%InstalPath%\Notification Server\Bin' and allows to run C# files as 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 script for development to fix 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.