embed .exe file in to vb

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beyrself
    New Member
    • Dec 2008
    • 6

    #1

    embed .exe file in to vb

    hi there i'm created a windows application using vb.net but now i have an issue. My program works by running a .exe file from c:drive. Can i embed the .exe file in the cdrive to my vb program so when i compile it, its being compile into a single .exe file?


    Thanks!
  • nukefusion
    Recognized Expert New Member
    • Mar 2008
    • 221

    #2
    I guess you could if you wanted to. Assuming your using Visual Studio, right-click the project and choose "Add Existing Item", select your .exe. Once added, select it and go to Properties and then change the build action to Embedded Resource.

    You'd then have an .exe embedded within an .exe. You'd have to do some fiddling around to actually run it though.

    You might be better off just keeping the files seperate. To do this you could set the build action to content/copy always and run the seperate .exe file from the application directory.

    Comment

    • beyrself
      New Member
      • Dec 2008
      • 6

      #3
      hi thanks for your reply.

      Just another question. i've tried embedding the .exe file into my .vb application. But i couldn't seem to get the path right to run my app? can u give me some guidance.

      For example i would like the run the dnsredir.exe file i'm embedded.

      Shell("dnsredir .exe", 1)

      but it says file not found?
      can you please help me with that?

      Thanks! (:

      Comment

      • lotus18
        Contributor
        • Nov 2007
        • 865

        #4
        Originally posted by beyrself
        hi thanks for your reply.

        Just another question. i've tried embedding the .exe file into my .vb application. But i couldn't seem to get the path right to run my app? can u give me some guidance.


        Thanks! (:
        Use Application.Sta rtupPath or Application.Use rAppDataPath

        For example i would like the run the dnsredir.exe file i'm embedded.

        Shell("dnsredir .exe", 1)

        but it says file not found?
        can you please help me with that?
        Instead of using the old vb Shell, try it in .net

        Code:
        System.Diagnostics.Process.Start()


        Rey Sean

        Comment

        Working...