Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

joining

Posted on 1999-06-30
8
Medium Priority
?
204 Views
Last Modified: 2010-05-02
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!
0
Comment
Question by:alexbeaty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1521127
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
 

Author Comment

by:alexbeaty
ID: 1521128
It looks fine, but it gives an error while compiling in

Get #1,,S2
0
 

Author Comment

by:alexbeaty
ID: 1521129
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:MikeP090797
ID: 1521130
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
 

Author Comment

by:alexbeaty
ID: 1521131
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
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1521132
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
 

Author Comment

by:alexbeaty
ID: 1521133
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
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1521134
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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question