Hello fellas, I have a slight problem. I have created an application where I am using linklabels to refer to a website, this works with no problem at all, however the problem that I do have is I cant work out the command to refer to a file or document.

The code to refer to a file on my PC is simple enough and works fine:

System.Diagnostics.Process.Start("C:\Users\LAPTOP-PC\Documents\SOPs\docs\NOTICAS.pdf")

and the code for the websites is also ok

System.Diagnostics.Process.Start("www.anywebsite.com")

Now once when the application is published, the code still works, however this is because it is on my PC and so are the files/documents. The intention is to burn the program to a disk and have it install to a different location on a different PC so naturally I do not have any control where the application is installed

Naturally when the application is burnt and I take it to a different PC, the application will not refer to the files because it is no longer referring to my PC and the location of the files, I have used the code:

System.Diagnostics.Process.Start(Application.StartupPath + "\\docs\NOTICAS.doc")

this code still does not work, because the documents/files seem not to build with the program and returns and error of "the network path was not found"

Can someone please assist by explaining how I can get my application to burn to a CD, with the files/documents and what codes to use. I think this is something like opening a file or document in same folder as application.

I hope I have explained it enough, I am so frustrated.

Damn it I think I put this in the wrong place...I am using Visual Basic 2010 express
sorry if I did

Thank You

Edited 6 Years Ago by Ubique: n/a

On the Setup Project, Select the ApplicationFolder
Add a new folder called docs.
Select the folder docs.
Add Files to this folder. On the Files dialog, you can select multiple files.
Bild the application setup, and you can burn you CD. The documents always will be into the docs folder so your

System.Diagnostics.Process.Start(Application.StartupPath + "\docs\NOTICAS.doc")

shoul work.

Hope this helps

Edited 6 Years Ago by lolafuertes: n/a

Thank you but Im just not to sure what you meand by

On the Setup Project, Select the ApplicationFolder

where can I find this.

Sorry Im a real no0b

Edited 6 Years Ago by Ubique: n/a

In order to distribute your application properly, you need to add to your solution a 'Setup' project for the apllication you are creating.

You can select the Setup Wizard to help you selecting the right elements to include in your application. You only need to select the Primary Output from your application to be added. Then finish the wizard and it will scan your application to find wich references to include an their sources.

On the left pane will appear the information I mentioned.

For instance, refer to http://support.microsoft.com/kb/307353/en-us, http://support.microsoft.com/kb/307358/en-us, http://support.microsoft.com/kb/307367/en-us or go to http://msdn.microsoft.com/en-us/library/aa720326.aspx

Hope this helps

This article has been dead for over six months. Start a new discussion instead.