Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
String path = @"C:\ProgramData\Microsoft\Windows\Start Menu\Program";
Process.Start (path, "*.lnk");
Posted
Comments
[no name] 20-Oct-15 5:00am    
You can specify the path as you did it will open the directory specified.

What error you are getting.
Nigol_Learner 20-Oct-15 5:11am    
This is the error I'm getting Bro......

An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll

Additional information: The system cannot find the file specified

The signature is: Process.Start (Filename, Arguments);
You are trying to start a directory with "*.lnk" as parameter. I don't think it will work. You could try something like this:
Process.Start(@"%windir%\explorer.exe", @"C:\ProgramData\Microsoft\Windows\Start Menu\Program");

Good luck!
 
Share this answer
 
v2
What are you passing in
Process.Start (path, "*.lnk");

in the Process.Start() method second parameter command line arguments.
In your case I think you need not to pass a command line argument. so leave it blank.
C#
String path = @"C:\ProgramData\Microsoft\Windows\Start Menu\Program";
Process.Start (path, "");
 
Share this answer
 
Comments
Nigol_Learner 20-Oct-15 5:22am    
Im So sorry to both of you Guys,,,,, Actually I Done Stupid Things....

@"C:\ProgramData\Microsoft\Windows\Start Menu\Program"

To

@"C:\ProgramData\Microsoft\Windows\Start Menu\Programs"

Missing S (Program to Programs)
[no name] 20-Oct-15 5:25am    
Also need not to pass "*.lnk" as 2nd parameter in Process.Start() method.
Nigol_Learner 20-Oct-15 5:27am    
Thanks Bro
[no name] 20-Oct-15 5:32am    
Never mind. Is that Okay.

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