Click to See Complete Forum and Search --> : How do i use this command in VB5?
WeedHead
July 23rd, 1999, 07:45 AM
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.
Lothar Haensler
July 23rd, 1999, 07:54 AM
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.
WeedHead
July 23rd, 1999, 08:44 AM
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?
Lothar Haensler
July 23rd, 1999, 09:42 AM
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
WeedHead
July 24th, 1999, 09:22 AM
Super!
now with that you can rename you jpg file to zip and extract it using winzip! its just nifty!
Later,
WeedHead
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.