Site logo

Running shell scripts

Snippet for grabbing the deep name of the computer

function getComputerName(){
	
	var APLScript = "get computer name of (system info)";
	var VBScript = "Dim wshShell\
	Set wshShell = CreateObject( \"WScript.Shell\" )\
	strComputerName = wshShell.ExpandEnvironmentStrings( \"%COMPUTERNAME%\" )\
	app.scriptArgs.SetValue \"computerName\", strComputerName";

	var scpt = (File.fs=="Windows")? VBScript : APLScript;
	var language = (File.fs=="Windows")? ScriptLanguage.visualBasic : ScriptLanguage.APPLESCRIPT_LANGUAGE;

	var scriptResult = app.doScript(scpt, language);

	var computerName = (File.fs=="Windows")? app.scriptArgs.getValue("computerName") : scriptResult;

	return computerName;
}

Get network adapter Name/MAC/Speed script