I would like to obtain the current process id in a JScript script. This id is returned by the Windows API GetCurrentProcessId (http://msdn.microsoft.com/en-us/library/ms683180.aspx) function. How do I call this function in JScript?
This obviously doesn't work:
var id = GetCurrentProcessId();
WScript.Echo("ProcessId is " + id);
Windows APIs aren't made available to the JScript runtime. You're limited to methods and properties listed in the MSDN JScript language reference, although you can also connect to WMI and create instances of COM Objects to extend beyond JScript's limitations.
You have the answer in DynamicWrapperX v1.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With