0

I have here 2 file first one is open when i click on app and another is in subfolder where first app need open second one but my code works only if it's on the desktop and on the computer named admin if I move the app to a folder download or any other also it does not work i try on vm host where name of my pc is not admin and its not work .


Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Process.Start("C:\Users\admin\Desktop\Sportv\SportTV\bin\Debug\Resources\trial", "/c netstat -b")
        Dim result As Boolean = HandleRegistry()
        If result = False Then 'something went wrong
            MsgBox("Trial expired")
        Else
            MsgBox("Trial version")
        End If
    End Sub


I guess that I need something to look for the name of the computer and pathfile then to copy/add it and search for the path of the second app right?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
madafaka
  • 1
  • 1
  • I might not understand well but it seems like you are looking for the [executable directory](https://stackoverflow.com/questions/2593458/executable-directory-where-application-is-running-from). Then you just append the sub folder. – the_lotus Jul 25 '19 at 17:40
  • 1
    You can use `Application.StartupPath` to read the current path of your executable. Then use `Path.Combine` to create a sub-path: `Path.Combine(Application.StartupPath, "Resources\trial")`. – Jimi Jul 25 '19 at 17:42
  • `Process.Start(...)`, as it is, will just open a folder and nothing else, though. – Jimi Jul 25 '19 at 17:48

0 Answers0