binary copy

Posted on 2006-06-08
Last Modified: 2010-08-05

in dos you can copy two file to one with this command:  "copy  /B Filea + Fileb Filec"
In my case:
    Filea = text-file
    Fileb = pdf-file
    Filec = output file

Is this posible in VB?

For now i have a shell call to this instruction, but i want to do it all in vb.

Question by:De_Wim99
    LVL 26

    Expert Comment

    if shell works for you, y not use shell?
    LVL 26

    Accepted Solution

    Private Sub Command1_Click()
    Dim Filea As String, Fileb As String, Filec As String
    Dim ff As Integer, s As String, s1 As String
    Filea = "Text - file"
    Fileb = "pdf - file"
    Filec = "output file"
    ff = FreeFile
    Open Filea For Binary Access Read Lock Read Write As #ff
    s = Space$(LOF(ff))
    Get #ff, , s
    Close ff
    ff = FreeFile
    Open Fileb For Binary Access Read Lock Read Write As #ff
    s1 = Space$(LOF(ff))
    Get #ff, , s1
    Close ff

    ff = FreeFile
    Open Filec For Binary Access Write Lock Read Write As #ff
    Put #ff, , s & s1
    Close ff

    End Sub

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now