I am looking to find the path of files in the resources of a VB application. The application is simple.
It will automatically make a .7z file into a self extracting and launching file.
3 parts to this, 7zS.sfx, config.txt and an .7z archive i.e. Fruits.7z
The 7zS.sfx and config.txt will never change, so I am hoping to embed them, the .7z archive will be dragged into the application.
Now I need to run a commmand which is: copy /b RESOURCE PATH\7zS.sfx + RESOURCE PATH\config.txt + C:\Users\%username%\Desktop\Fruits\Fruit_List.7z Fruits.exe
I have tried this several times with My.Resource.config.txt, put it loads the files as a byte. I need the file untouched the command prompt will handle it after constructed too.
MyUtilities.RunCommandCom("copy /b c:\FruitTemp\7zS.sfx + c:\FruitTemp\config.txt + C:\Users\%username%\Desktop\Fruit\FruitArchive.7z c:\users\%username%\desktop\Fruit.exe", "/C", True)
Shared Sub RunCommandCom(command As String, arguments As String, permanent As Boolean)
Dim p As Process = New Process()
Dim pi As ProcessStartInfo = New ProcessStartInfo()
pi.Arguments = " " + If(permanent = True, "/K", "/C") + " " + command + " " + arguments
pi.FileName = "cmd.exe"
p.StartInfo = pi
p.Start()
End Sub
The embedded resources are now run through the byte and stored in a temp location as you can see from the commands above. However this command will not run. It states the syntax is incorrect.