PowerShell returned and pointed to the error in the code.
Breaking down the code, please notice the error in the opening single quote (end of second ine) without a matching closing single quote, as follow: $testargsacl = @(“ /subkeyreg ' HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Test Key”, “/grant=“Everyone”=F ”)
Thanks, I tried closing the quote and it still fails. I cleaned up the quotes on the end of the variable so now i’m not getting an error in powershell when running this and it is now running the subinacl.exe but is failing because there is a space in the Registry Key path.
To be honest I’m having a hard time understanding how to deal with spaces in powershell. I created a Registry Key simply called Test and the code below does work but unfortunately the software I am working with has spaces in the Key name. Any idea what I can do to get it to work on a Key named “Test Key”?
I don’t understand why you aren’t trying the powershell way that kvprasoon provided. That said, I recommend you use splatting for your command arguments. This works for me.