Writing a little script to uninstall Winvnc. My script is supposed to remove the C:\VNC folder but I keep getting :
cannot remove item c:\vnc\winvnc.exe: Access to the path ‘winvnc.exe’ is denied.
The odd part is that when I step through the lines manually it works with no errors. Is there something different about the way scripts are run vs how they are run manually?
Here is my script:
if ((Get-Process).ProcessName -eq “winvnc”)
Remove-Item c:\vnc\ -Recurse -Force