0

I want to open EXE file from the project resources,

This file require no installation just came with two .dll files, I put all the files inside the resources but my problem is the path will be different if I run my project from other computer.

I'm trying this method, it works but I guess I should use different path like for example "my.resources"

Can someone tell me how I can do that if the EXE file require two .dll files to run?

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Process.Start("C:\Users\PC\source\repos\WindowsApp2\WindowsApp2\Resources\TSICT.exe")
    End Sub
End Class
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
plzhelp
  • 13
  • 4
  • Not possible, the OS demands that it is file on disk. The user's anti-malware product does as well. Don't hard-code the path of the file, deploy it to the same directory as your main .EXE and use Application.StartupPath to find it back. – Hans Passant Feb 28 '19 at 18:21
  • @HansPassant I found this one, but I don't know how exactly gonna work if I want it from resources https://stackoverflow.com/questions/2631223/click-a-button-launch-a-exe-file – plzhelp Feb 28 '19 at 18:31
  • You can't execute a file from resources because there is no file. That's the point of a resource. It is data compiled into your EXE or DLL, not its own file. In order for you to run a program stored as a resource, you would have to extract the resource, save it to disk as a file and then execute that file. The code to do that is quite simple but the action will be blocked by most anti-malware programs and possibly by Windows itself, because that is something that a malicious program might do. As you have already been told, don't use a resource but just deploy that EXE with yours. – jmcilhinney Feb 28 '19 at 22:27
  • Now I got it @jmcilhinney :) – plzhelp Feb 28 '19 at 22:33

0 Answers0