开发者

Is it possible to File.Copy a file into a system folder? like System32?

开发者 https://www.devze.com 2022-12-14 16:14 出处:网络
I need to create files inside of a specific folder (\"开发者_StackOverflowC:\\Windows\\System32\\oobe\\info\\backgrounds\") and possibly create said folder. When I try this with the File.Copy command

I need to create files inside of a specific folder ("开发者_StackOverflowC:\Windows\System32\oobe\info\backgrounds") and possibly create said folder. When I try this with the File.Copy command windows won't grant the program permission, just throws an error. I am writing this in C# with VS2008.

EDIT: Windows 7, forgot about that part.


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

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

or

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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消