VB program and EXE

B

brian

I am very new at this type of situition and am looking
for guidance:

I am using VB.NET 2002 to write an app.
I have an .exe that needs to be incorporated into my
program. It's an RSYNC(novell synching utility)exe

I am going to get a job number and year from the user.
This will allow me to build a string of where the file is
stored in the directory.

Once I build the string I am going to run a shell command
from within my program such as:
c:\cwrsync\rsync.exe -vaz /cygdrive/c/TrussJobs/....etc

c:\cwrsync\rsync.exe (<--The exe I need to run)

Is there a way to store this file in a VB.NET program
when compiling and then copy it to the user without them
knowing it when the form is loaded so it is in place upon
submission?

OR

Is there a way to store an .exe in the program and when
trying to process the shell I can locate it somewhere?

So- in recaps, I need help distribuitng an exe to the
user in order to get my shell command to work properly.

This is not being used for corruption but to save my
users from needing to terminal in to our central location
and copy data. RSYNC can handle the copying of data for
us freeing up a lot of time and reducing bandwith greatly
since it compresses on the fly.

Thanks for any suggestions!
 
S

Sven Groot

brian said:
c:\cwrsync\rsync.exe (<--The exe I need to run)

Is there a way to store this file in a VB.NET program
when compiling and then copy it to the user without them
knowing it when the form is loaded so it is in place upon
submission?

If you can't just bundle the exe as a separate file with your own app, you
could embed the exe in your program as a resource.
You can then access it as a stream, write that stream out to a file and then
Shell out to that file when you need to use it. You can get at the embedded
resource stream using this:
Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MyApp.rsync.exe")

To get the file as a resource in your app, just add it to the project in
VS.NET and set its build action to "Embedded Resource".
 
B

brian shannon

Thanks for the reply.

By chance would you be able to give an example on how to write the
stream to a file?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top