Is it possible to file.copy a file in a system folder? how is system32?

I need to create files inside a specific folder ("C: \ Windows \ System32 \ oobe \ info \ backgrounds") and possibly create the specified folder. When I try to do this using the File.Copy command, windows will not grant permission to the program, it simply gives an error. I am writing this in C # with VS2008.

EDIT: Windows 7, forgot about this part.

+3
source share
1 answer

UAC. Have you added a manifest that requests elevated access? One of (don't ask me who ...):

<requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />

or

<requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

in the manifest file ( app.manifest). Settings are discussed on MSDN .

+8
source

Source: https://habr.com/ru/post/1726157/


All Articles