Has Windows 8 locked up Program Files in a way that Win 7 didn't? I have a script that uses Remove-Item to delete files and folders from C:\Program Files and it works fine in Win 7 but not in Win 8.1. Both users are local admins, execution policy is Unrestricted and AUC is minimal on both machines. Currently the script is not signed, but ultimately it will be and RemoteSigned will be the policy, if that has any impact. I hope not because it would make development a pain.
Anyway, hoping for some insights. I would guess 99% of my users are not going to Win 8 in any flavor for at least another year or more, likely not till they can go to 9, but I would like to support the new Vista if possible. ;)
EDIT: on a possibly related note, is there anything that needs to be handled in script when launching with elevated privileges via a shortcut? The shortcut passes arguments to the script, so I need that procedure. And when I launch the shortcut with Run
as Administrator I get a flash of error red text and the console is gone. Which is odd because the shortcut uses the -noexit flag.
And lastly, the other way the scripts are launched is with SCCM. I assume if the only way to get things to work in Win 8 and above is elevated privileges, there is a way to push an elevated script in SCCM?
EDIT 2: Seems I have the same problem with deleting reg keys from HKLM. Code worked fine in Win 7, fails with permission errors in Win 8.1. Fun.
Thanks!
Gordon