Click here to Skip to main content
15,921,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I want to create a folder in start menu using c# console application. I don't know how to start. I shall be thankful for your help.
Posted

1 solution

The code is pretty simple:
C#
string startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu);
DirectoryInfo di = new DirectoryInfo(startMenuPath);
di.CreateSubdirectory("Testfolder");
But (and it's a big but) - you will need admin privileges to do it, or you will get an "access denied" exception.
 
Share this answer
 
Comments
osama.javed 15-May-13 4:13am    
Thank you so much sir,
can i get the path of the start menu folder by
string startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu);
??
OriginalGriff 15-May-13 4:27am    
How many guesses do you want? :laugh:
osama.javed 15-May-13 4:30am    
:)...
osama.javed 15-May-13 4:22am    
string startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu);
this gives me path of Start menu, i want the path of Programs/All Programs in start menu. how can i get it?? thnx
OriginalGriff 15-May-13 4:31am    
Oooo! That's a difficult one!
Is it that you add the "\Programs" part to the string?
I think it could be, you know...

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