471,109 Members | 1,435 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,109 software developers and data experts.

VB program and EXE

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!
Nov 20 '05 #1
2 4002
brian wrote:
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().GetMani festResourceStream("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".

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 20 '05 #2

Thanks for the reply.

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

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

22 posts views Thread by edgrsprj | last post: by
11 posts views Thread by christopher diggins | last post: by
1 post views Thread by Eric Whittaker | last post: by
9 posts views Thread by Hemal | last post: by
7 posts views Thread by ibtc209 | last post: by
Banfa
2 posts views Thread by Banfa | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.