can you help me any one for create the folder,how to create the folder in program files folder ?
thanking you
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted Dec 2, 2012, 9:09 PM EST
Are you trying to deploy something, then try the Setup project.
guru surya5 reputationPosted Dec 2, 2012, 9:35 PM EST
thanking you, i have write my code below
Vithal WadjeRank #19 · 47.2K reputationPosted Dec 3, 2012, 12:34 AM EST
Karthi KeyanRank #1,926 · 762 reputationPosted May 1, 2017, 10:10 PM EDT
Rafnas T PRank #280 · 8.8K reputationPosted May 1, 2017, 10:18 PM EDT
Rathrola Prem KumarRank #307 · 8.2K reputationPosted May 1, 2017, 10:38 PM EDT
The
C:\program filesfolder is protected (by design) in Vista and Windows 7 (and Windows Server 2008 / 2008 R2) - normal user accounts do not have any permission to create directories in there - it's a system folder.Either you need to run as admin - then you have permission to create directories even in protected system folders - or you create the directories elsewhere and not inside a protected system folder. The second option would be the recommended and preferred option.
Dharmraj ThakurRank #577 · 4.2K reputationPosted May 2, 2017, 1:14 AM EDT
Waruna Manjula51 reputationPosted May 1, 2017, 8:28 PM EDT
using System.Security.Principal;
Waruna Manjula51 reputationPosted May 1, 2017, 10:57 PM EDT
You'll want to modify the manifest that gets embedded in the program. This works on Visual Studio 2008 and higher: Project + Add New Item, select "Application Manifest File". Change the
element to:requestedExecutionLevel level="requireAdministrator" uiAccess="false" />The user gets the UAC prompt when they start the program. Use wisely; their patience can wear out quickly.