Click here to Skip to main content
16,004,678 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi. is it Possible to invoke .vbs or .chm files in csharp. For example If I click on Button It must Open the file of matching filename and extention from HardDisk..I can easily open if i give the full link but the drive where it is located may vary ....so I want to take 'View' folder which is inside my Project directory and also shows at my solution explorer as Root folder so that it works Help.chm placed in View folder....now now i can copy the whole project folder including that math folder and run without problem
Here what I meant
<br />
System.Diagnostics.Process.Start(@"C:\Documents and Settings\Munni\My Documents\UCMAS\abacus_Buttons_updated\Abacus.Main\View\Help\Abacus Park 2008.chm");<br />

If the project folder is not in 'my documents' it wont work even if view and help folder are present
What i wanted to do is Instead of searching from C:\... I want to search that file only from view folder so that I can take abacus_Buttons_updated folder anywhere i like and still run with no problem...
Posted
Updated 19-Jan-10 6:19am
v2

You can use the relative path from your executible. For example use "\Abacus.Main\View\Help\Abacus Park 2008.chm" instead of @"C:\Documents and Settings\Munni\My Documents\UCMAS\abacus_Buttons_updated\Abacus.Main\View\Help\Abacus Park 2008.chm if your exe is in abacus_Buttons_updated.
 
Share this answer
 
I think the problem might be the spaces in your command line. You need to quote the enitre command. Change your code to this:

SQL
System.Diagnostics.Process.Start(@"\"C:\Documents and Settings\Munni\My Documents\UCMAS\abacus_Buttons_updated\Abacus.Main\View\Help\Abacus Park 2008.chm\"");
 
Share this answer
 
v2
I think You didnt get my question. What i wanted to do is Instead of searching from C:\... I want to search that file only from view folder so that I can take abacus_Buttons_updated folder anywhere i like and still run with no problem...
 
Share this answer
 

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