CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 1999
    Posts
    3

    How do i use this command in VB5?

    Help. i am trying to use this command in VB5 but not as part of a Batch file.
    the comand is:
    ---------------------------------------------------------
    Copy /b pic.jpg+*01.zip files\program-01.jpg
    ---------------------------------------------------------
    the command is for a Batch file of a DOS promt. how would i do the same thing in VB with out creating a Batch file and running it. I may even get desperate and make do with shell commands. but i need the sytax.


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How do i use this command in VB5?

    the only support VB offers is the FileCopy command.
    Filecopy a, b
    But, from your question I see that you try to concatenate files.
    You need to read each file and append it to the target manually.


  3. #3
    Join Date
    Jul 1999
    Posts
    3

    Great! but...

    Just one question how would i append the zip file to the Jpg file?
    i tried to use open "thepic.jpg" for append as #1
    print #1, archive.zip
    close #1


    is that totaly wrong or just partioaly wrong. anyhow what would be the right thing?


  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: Great! but...

    I am very confused about what you are trying to do.
    Are you trying to append a ZIP file to a jpg file? What would the result be?

    Well, let's assume that you know what you are doing :-)
    to append a zip to a jpg

    private Sub Command1_Click()
    Dim hfile as Integer
    hfile = FreeFile
    Open "c:\thepic.jpg" for Append as #hfile
    Dim hIn as Integer
    hIn = FreeFile
    Dim strbuffer as string
    Dim strArchive as string
    strArchive = "c:\archive.zip"
    strbuffer = string(FileLen(strArchive), vbNull)
    Open "archive.zip" for binary as #hIn
    get hIn, , strbuffer
    print #hfile, strbuffer
    Close hIn
    Close hfile
    End Sub





  5. #5
    Join Date
    Jul 1999
    Posts
    3

    Yes!

    Super!
    now with that you can rename you jpg file to zip and extract it using winzip! its just nifty!

    Later,
    WeedHead

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured