I'm using following code in JScript (WSH) to connect to local registry using WMI: var registry = GetObject('winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\default:StdRegProv');
and that works.
Then I have to determine if I'm allowed to delete key without really trying to delete it (e.g. perform a non-destructive check). I looked over docs and found that I need StdRegProv.CheckAccess()
method. Problem is that CheckAccess
returns result as out
argument and I could not find VBScript's ByRef
equivalent in JScript.
Somewhere in the Internet I've found that using SWbemServices.ExecMethod
would help somehow, but I hadn't figured out how can I use that yet.
Could anyone provide me with code sample in JScript performing function call with argument passed by reference?