Ryan_Moran
11 years agoValued Contributor
JScript Built in method to run shell commands
Looking for a built in method to run shell commands. Currently using: wshell = new ActiveXObject('WScript.Shell'); function run(p){ wshell.run(p); } Thanks.
- 11 years agoHi Ryan, the CLR Bridge allows for the usage of managed assemblies created using the .Net framework, see the documentation here
For example, the following code shows how to create a GUID using System.Guid in the .Net Framework
function createGuid() {
var guid = dotNET.System.Guid.NewGuid();
Log.Message( guid.ToString() );
}
Be aware, though, the CLR Bridge is not able to expose all .Net Classes as you would expect in Visual Studio, therefore I have created a number of .Net helper assemblies that I use to wrap up any .Net functionality I want to utilise.
User32.dll is not available to CLR Bridge as it is not a managed assembly, however, the documentation here describes now you can access User32.dll
Phil