Jump to content

cbox


[help] Visual Basic 2008 Start Process Issue


Recommended Posts

Posted (edited)

SOLVED

Thanks to, Peaches & dennijr

 

This is the code that worked for me:

Process.Start(Application.StartupPath & "\apps\test.txt")

 

----------------------------------------------------------------------------------------------------

 

I'm making a program that is basicly a AIO. I have a code where it open's the program i want, ete.

I'm using this code:

System.Diagnostics.Process.Start("test.txt")

 

But i don't want the program\files to be in the same folder as the .exe

 

 

I want it like this, and when i do this i get a ERROR

System.Diagnostics.Process.Start("apps\test.txt")

 

 

Here is what i want it to be/work like:

http://i7m.net/files/Images/Screenshots/image001.PNG

 

 

 

****

So, my question is; how do i fix this?

Edited by i7m
Posted

When you start the file just by using test.txt it uses the current directory automatically. So now when you add apps its looking in C:apps\test.txt

 

Instead use

 

 Application.StartupPath & "\\apps\\" & "test.txt" ;

Posted (edited)

When you start the file just by using test.txt it uses the current directory automatically. So now when you add apps its looking in C:apps\test.txt

 

Instead use

 

 Application.StartupPath & "\\apps\\" & "test.txt" ;

 

I just tryed that, and know i have that blue zig-zag line under the text.

And i can't publish (errorzzz)

 

 

 

 

 

are you trying to make it so u can click a button on the prgram and it opens a file/program?

 

 

Yes.

Edited by i7m
Posted (edited)

try this:

 

Process.Start(Application.StartupPath & "\apps\test.txt")

 

that should do it

 

 

hmm, peaches posted while i was playin around with it

 

and is there a reason why your all using System.Diagnostics.Process.Start when Process.Start works fine on its own?

 

 

Application.StartupPath & "\\apps\\" & "test.txt" ;

hehe, this looks like c++ or c#, going by the escape characters and the semi-colon :p

Edited by dennijr
Posted

I remember little to no VB. All I remember is instead of + there is a &, I was so confused. So I opened up VB and just typed it in.

haha, i know what you mean, when u try to use a language u havent used in a while, its not easy :p

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...