int RunCommand ( string command )
Returns OK if successful. Otherwise, returns FAIL.
command– string variable
containing the command which is to be executed.
Call this function to execute a process
synchronously - i.e., it will wait until the external process is
closed before further execution occurs. The application/command
will run in silent mode (no application window will show up)
Plug-in module: nd_process.npl
The following example demonstrates the use of
func AddIPAddress(string sIPAddress)
Println("Adding IP address: ", sIPAddress)
sIP = "netsh in ip add address " + DOUBLE_QUOTE + "Local Area Connection" + DOUBLE_QUOTE + " " + sIPAddress + " 255.0.0.0"
if (RunCommand(sIP) == FAIL)
Println("Creating virtual IP interfaces:")
string sIPBase = "192.168.1."
int nStartRange = 1
int nEndRange = 10
for(int i=nStartRange; i<=nEndRange;
string sAddr =
sIPBase + ToString(i)
if (AddIPAddress(sAddr) == FAIL)
Println("Failed to add ", sAddr)