Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4622644
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:52:21+00:00 2026-05-22T02:52:21+00:00

I have to concatenate 3 binary files into one, but I am getting an

  • 0

I have to concatenate 3 binary files into one, but I am getting an error while I try it. Here is my code:

' This is a simple example of managing binary files in
' vbscript using the ADODB object
dim inStream,outStream
const adTypeText=2
const adTypeBinary=1

' We can create the scream object directly, it does not
' need to be built from a record set or anything like that
set inStream=WScript.CreateObject("ADODB.Stream")

' We call open on the stream with no arguments.  This makes
' the stream become an empty container which can be then
' used for what operations we want
inStream.Open
inStream.type=adTypeBinary

' Now we load a really BIG file.  This should show if the object
' reads the whole file at once or just attaches to the file on
' disk
' You must change this path to something on your computer!
inStream.LoadFromFile(Zip7sSFX)
dim buff1
buff1 = inStream.Read()
inStream.LoadFromFile(Config)
dim buff2 
buff2= inStream.Read()
inStream.LoadFromFile(PackName)
dim buff3 
buff3= inStream.Read()
' Copy the dat over to a stream for outputting
set outStream=WScript.CreateObject("ADODB.Stream")
outStream.Open
outStream.type=adTypeBinary

dim buff
buff=buff1 & buff2 & buff3

' Write out to a file
outStream.Write(buff)
' You must change this path to something on your computer!
outStream.SaveToFile(OutputFile)

outStream.Close()
inStream.Close()

End Sub

What I am doing wrong? It complains about buff type mismatch.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:52:22+00:00Added an answer on May 22, 2026 at 2:52 am

    You cannot concatenate your buffs with & as they are (byte())Variants, instead you can append to the output stream directly:

    const adTypeText=2
    const adTypeBinary=1
    
    dim inStream, outStream
    
    set inStream=WScript.CreateObject("ADODB.Stream")
    set outStream=WScript.CreateObject("ADODB.Stream")
    
    inStream.Open
    inStream.type=adTypeBinary
    
    outStream.Open
    outStream.type=adTypeBinary
    
    inStream.LoadFromFile(Zip7sSFX)
    outStream.Write = inStream.Read()
    
    inStream.LoadFromFile(Config)
    outStream.Write = inStream.Read()
    
    inStream.LoadFromFile(PackName)
    outStream.Write = inStream.Read()
    
    outStream.SaveToFile(OutputFile)
    
    outStream.Close()
    inStream.Close()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this line of code which I want to concatenate -or at least
Straight into business: I have code looking roughly like this: char* assemble(int param) {
I have this requirement to concatenate data from DNR2 (Parent) Message Data into the
I am having three arraylist,Here I have to concatenate 2 arraylist and display it
I have a code to concatenate strings. However, for some reason, the final string
Possible Duplicate: Concatenate row values T-SQL I have a table like this: ref_num name
I have an array, and i want to concatenate it with a string. this
I have the binary for several pdf files stored in a collection of Byte
I understand there are multiple questions about this on SO, but I have yet
I have some doubts about how to concatenate MvcHtmlString instances because of this information

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.