Miles LLC Posted March 5, 2010 Report Posted March 5, 2010 (edited) SOLVEDThanks 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 ERRORSystem.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 March 5, 2010 by i7m
iBotPeaches Posted March 5, 2010 Report Posted March 5, 2010 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" ;
theron324 Posted March 5, 2010 Report Posted March 5, 2010 are you trying to make it so u can click a button on the prgram and it opens a file/program?
Miles LLC Posted March 5, 2010 Author Report Posted March 5, 2010 (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 March 5, 2010 by i7m
iBotPeaches Posted March 5, 2010 Report Posted March 5, 2010 no error with this Dim coolString As String = Application.StartupPath & "apps" & "test.txt" so System.Diagnostics.Process.Start(Application.StartupPath & "apps" & "test.txt")
dennijr Posted March 5, 2010 Report Posted March 5, 2010 (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 Edited March 5, 2010 by dennijr
iBotPeaches Posted March 5, 2010 Report Posted March 5, 2010 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.
dennijr Posted March 5, 2010 Report Posted March 5, 2010 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
Miles LLC Posted March 5, 2010 Author Report Posted March 5, 2010 try this:Process.Start(Application.StartupPath & "\apps\test.txt") Your's work perfectly. lol, peaches for some reason both of your's didn't work. Thanks Though
iBotPeaches Posted March 5, 2010 Report Posted March 5, 2010 I think its cause I forgot a backslash that I just noticed.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now