# Get the security principal for the Administrator role
# Check to see if we are currently running "as Administrator"
# Create a new process object that starts PowerShell
# Specify the current script path and name as a parameter
# Indicate that the process should be elevated
# Start the new process
# Exit from the current, unelevated, process
# Run your code that needs to be elevated here
#takeown of folders
takeown /f c:\Program Files (x86)\FinAnal30 /r /d Y
I'm sorry, but we're not going to be able to run your code and reproduce your results. If you're encountering an error or something, you're going to have to help us understand what that is.
Although if the problem is solely with TAKEOWN or ICACLS, understand that those aren't actually PowerShell – they're external commands.
You must be logged in to reply to this topic.