joining

I´m curious... how can someone join 2 files in 1?

I´ve tried something like:

--------

Open ("c:\windows\desktop\test.exe") For Binary Access Read As #1
        Get #1, 1, firstfile
        Close #1
             
Open ("c:\windows\desktop\test2.exe") For Binary Access Read As #1
    Get #1, 1, secondfile
    Close #1
                                               
Open ("c:\windows\desktop\result.exe") For Binary Access Write As #1
    Put #1, , firstfile
    Put #1, , secondfile
    Close #1


--------

But I had no results!!
Does anyone know how to do such a thing?
Thx anyway!
alexbeatyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MikeP090797Commented:
Try something like this:
Dim S1 as string, S2 as string
Open ("c:\windows\desktop\test.exe") For Binary Access Read As #1

S1=Space(Lof(1))
Get #1,,S1
Close #1

Open ("c:\windows\desktop\test.exe2") For Binary Access Read As #2

S2=Space(Lof(2))
Get #1,,S2
Close #2

Open ("c:\windows\desktop\result.exe") For Binary Access Write As #1
    Put #1, , S1
    Put #1, , S2
    Close #1






0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
alexbeatyAuthor Commented:
It looks fine, but it gives an error while compiling in

Get #1,,S2
0
alexbeatyAuthor Commented:
Forget about the error that I said!!!

But seems that we have another problem!
When we join the 2 and the result of them is result.exe, this file has the size of the 2 together but when you run it, it only runs the first program in the file!!!

I thought when the result.exe was executed we could "extract" the 2 inside the result.exe to a temp directory, shell the 2 and kill the 2. This way they would run both seeming that it was the result.exe!

..., but just can´t figure how to do this!
Whats your opinion?
Thx for your help
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

MikeP090797Commented:
Well that's almost impossible to achieve I'd say. An EXE file has a special format, when you combine two files, this format is lost - the OS can't find the header and other stuff that are req. It's pretty amazing that the first one runs..
0
alexbeatyAuthor Commented:
I understand what you are saying, but is absolutely possible! I´ve seen one exe joiner and it works very well!
I think it works just like I described in my former comment! (extracting to a temp and shell them from there)
 
0
MikeP090797Commented:
Well that's something more complex then just two files placed one after another. It's called self extracting EXE-the exe header is modified, so the os loads only part of the file as the exe, and not what actualy exists
0
alexbeatyAuthor Commented:
So how can I make a simple exe that is compact and when executed it will copy the 2 of them to a temp dir and shell them?

The only problem I see is that when ran it would take a while!!


0
MikeP090797Commented:
That's  VERY complecated, and honestly, I don't know all the details. To start with, download the EXE file format from www.wotsit.org, it will give you an idea on what's involved, after that, you might reconsider this. Basicly it involves changing a few values in the exe header, like length, offsets, ect..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.