none
New in Visual Studio Need Help RRS feed

  • Question

  • Hello to all users  in this forum. I am new user in visual studio I just start to work with this Program . now I try to make a simple page that have 2 Batton that run simple exe program that is on my computer and no need to pre install . all work good whan I give to this batton path to these  program  like in this line that I put below  all work good 

    IO.Directory.SetCurrentDirectory("C:\Users\Daniel Mobile Lab\Desktop\Odin3_v3.12.7\")

    System.Diagnostics.Process.Start("C:\Users\Daniel Mobile Lab\Desktop\Odin3_v3.12.7\Odin3_v3.12.7.exe")

    but I want to do somthing eles I want to Add these  files to resources . and to run this program from the resources . now whan I add all files and put the line commends to run the program I have an error

    Severity Code Description Project File Line Suppression State
    Error BC30201 Expression expected. Daniel Mobile Tool C:\Users\Daniel Mobile Lab\source\repos\Daniel Mobile Tool\Daniel Mobile Tool\Form1.vb 4 Active

    but its run the program now whan I try to run program from the batton I gut  another error now from the program itselfe way because this program need ini file that is came with the Odin.exe file now I try to give a path to this ini file that is inside the resources but no luck  IO.File.WriteAllBytes(My.Computer.FileSystem.SpecialDirectories.Temp & "\Odin3.ini", My.Resources.Odin3)

    IO.File.WriteAllBytes(My.Computer.FileSystem.SpecialDirectories.Temp & "\Odin3_v3.12.7.exe", My.Resources.Odin3_v3_12_7.12.7)

    Process.Start(My.Computer.FileSystem.SpecialDirectories.Temp & "\Odin3_v3.12.7.exe")

    I relly need your help I have more stuff that I need help but I want to fix Problem one by one thank to all that will help me 





    • Edited by Daniel Mouyal Wednesday, October 25, 2017 2:07 PM
    • Moved by 宝宝徐 Thursday, October 26, 2017 5:49 AM
    Wednesday, October 25, 2017 1:54 PM

All replies

  • Hello to all users in this forum . I am new user in visual studio I just start to work with this Program . now I try to make a simple page that contine a 2 batton and run exe file program that is on my computer and no need to do pre install to these program . all work good whan I give to this batton path like in this line that I put below all work good 

    IO.Directory.SetCurrentDirectory("C:\Users\Daniel Mobile Lab\Desktop\Odin3_v3.12.7\")

    System.Diagnostics.Process.Start("C:\Users\Daniel Mobile Lab\Desktop\Odin3_v3.12.7\Odin3_v3.12.7.exe")

    but I want to do somthing eles I want to Add these  files to resources . and to run this programs from the resources . now whan I add all files and put the line commends to run the program I have an error

    Severity Code Description Project File Line Suppression State
    Error BC30201 Expression expected. Daniel Mobile Tool C:\Users\Daniel Mobile Lab\source\repos\Daniel Mobile Tool\Daniel Mobile Tool\Form1.vb 4 Active

    but its run the program now whan I try to run the program from the batton I gut  another error now from the program itselfe way because this program need ini file that is came with the Odin.exe file now I try to give a path to this ini file that is inside the resources  

    IO.File.WriteAllBytes(My.Computer.FileSystem.SpecialDirectories.Temp & "\Odin3.ini", My.Resources.Odin3)

    IO.File.WriteAllBytes(My.Computer.FileSystem.SpecialDirectories.Temp & "\Odin3_v3.12.7.exe", My.Resources.Odin3_v3_12_7.12.7)

    Process.Start(My.Computer.FileSystem.SpecialDirectories.Temp & "\Odin3_v3.12.7.exe")

    but no luck I relly need your help I have more stuff that I need help but I want to fix Problem one by one thank to all that will help me 


    • Edited by Daniel Mouyal Wednesday, October 25, 2017 2:17 PM
    • Merged by 宝宝徐 Friday, October 27, 2017 7:12 AM the same
    Wednesday, October 25, 2017 2:16 PM
  • Hi Daniel,

    you don't post duplicate posts to this forums. 

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/aef08977-db8e-4d0c-9efe-6ac10efe24de/new-in-visual-studio-need-help?forum=visualstudiogeneral


    Santhakumar Munuswamy http://www.san2debug.net


    Wednesday, October 25, 2017 2:36 PM
  • Hi,

    Welcome to MSDN forum.

    I will move your thread to VB forum for professional support, If you have problem about visual studio IDE, please feel free to let me know.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 26, 2017 5:47 AM
  • thank you so much for your help ware I will see the post that I write after you move it ?
    Thursday, October 26, 2017 6:45 AM
  • My guess is that because you have spaces in the folder name this is causing the problem, not sure. Here is what I did using a .exe file in My.Resources.

    IO.File.WriteAllBytes(IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.Temp, "Console.exe"),
                            My.Resources.ConsoleApp3)
    Process.Start(IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.Temp, "Console.exe"))


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites


    Thursday, October 26, 2017 1:08 PM
    Moderator
  • I try to make A new project with a simple name without spaces and the same problem. now I know what is my problem I try to run simple exe file. the file is Odin3.exe and for this file exe to work is need that this Odin3.ini will be in the same folder when the Odin3.exe been. when I put this line that Contains the Odin3.ini all work good. 

    IO.Directory.SetCurrentDirectory("C:\Users\Daniel Mobile Lab\Desktop\Odin3_v3.12.7\")

     

    now like I say before I want to run all the files not from my computer I want to run them from Resources now the when I press on the button that I make to run this exe file.  it run the exe but give me error that is can't find Odin3.ini  file now I want to know if you can tell me when I need to write to give path to the Odin.ini file that is in Resources and it will solve me the problem that I have  I upload video to YouTube to show you what I men 

    https://www.youtube.com/watch?v=oQXcSw1Mohk&t=10s&list=FLW8dYyfDKdJqn3gxH75sU0A&index=1

    Thursday, October 26, 2017 7:41 PM
  • Hi Daniel,

    If you want to run enabled resource in the another application, you can take a look the steps below.

    1. Double-click on My Project to open the property pages and go to the Resources Tab. Now click Add Resource > Add Existing File. Browse to the file you want to embed.

    2.You will also see that a folder named Resources was created under your project and the embedded file has been placed in this folder

    3.Click Resourec_name,look down at the properties window for the file and change the build action to Embedded Resource

    Now, you can use Kareninstructor's code to run the .exe.

     IO.File.WriteAllBytes(IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.Temp, "Test.exe"), My.Resources.Test)
            Process.Start(IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.Temp, "Test.exe"))

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 31, 2017 7:33 AM
    Moderator
  • Thank  you for your Replay . Sorry my mistaik its not a dll file its ini file . but like I told in the Replay to karen payne and I do a quick video that show my problem . I will ask short question I have  a ini file that I add to the resources how I add a path to this ini . when I give path to this ini in simple way like in this line 

    IO.Directory.SetCurrentDirectory("C:\Users\Daniel-Mobile-Lab\Desktop\Odin3\") System.Diagnostics.Process.Start("C:\Users\Daniel-Mobile-Lab\Desktop\Odin3_v3.12.7\  Odin3_v3.12.7.exe")

    so I want to know if you can tell me and write me the commend how I give to my one ini file that I add to resources the path because all work for me good I press the button that I made it try to run the odin.exe file that I put in the resources but it's give an error that is don't find the ini file . this odin.exe cannot run without this ini file .


    Friday, November 3, 2017 8:26 AM