Click here to Skip to main content
15,891,740 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

i want to copy some folder from 'c' drive to 'd' drive.

i used windows form with c# but it failed due to 'access denied'. Admin permission but the code is running on admin login



Thanks Regards,

sujay.
Posted
Comments
Sergey Alexandrovich Kryukov 8-Jul-13 11:27am    
OS version?
—SA

1 solution

Admin login is no enough. On Windows Vista and later versions, you need to run an application with elevated privileges. Please see:
http://www.sevenforums.com/tutorials/11841-run-administrator.html[^].

—SA
 
Share this answer
 
Comments
H.Brydon 8-Jul-13 22:34pm    
+5 as usual.

... and don't forget that the file or directory can be on a write locked drive, a drive where space is not available, the file/directory can be protected against admin access (or the current username) or probably other things as well. The access failure is usually for the destination, but could also be the source file/dir...
Sergey Alexandrovich Kryukov 8-Jul-13 23:01pm    
Thank you, Harvey. This is a good point.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900