|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VBScript - Converting several binary files into one
Good afternoon,
I am wondering how I would put a script together that would take several binary files, and copy them into one file. Using DOS, I normally type this out like so; Code:
copy /b file01.wav+file02.wav+file03.wav OneFile.wav with my script, I got to this point: Code:
'Initialization Section
Option Explicit
Const cTitle = "Binary File Conversion Wizard"
Dim objFSObject, objFolder, file, strFileList
Set objFSObject = CreateObject("Scripting.FileSystemObject")
'Main Processing Section
objFolder = InputBox("Enter directory where Binary files are found: ", cTitle)
Set objRootDir = objFSObject.GetFolder(objFolder)
'Procedure Section
For Each file In objRootDir.Files
file.copy /b
Next
and realized, I don't know how I would make this work properly. How would you make something like this work ?? Code:
file.copy /b file & "+" & file & "+" & ... |
|
#2
|
||||||||
|
||||||||
|
Perhaps the easiest way is to use the same concept. VBS can grab the file names and dynamically create your command line.
vb Code:
vb Code:
__________________
Click the image if at any point you don't like my decision.Scripting problems? Windows questions? Ask the Windows Guru! Last edited by Nilpo : August 12th, 2008 at 06:18 AM. |
|
#3
|
|||||||||
|
|||||||||
|
Quote:
vb Code:
I eventually figured this part (above) out, although it took me a bit of time in research. It was the file.Name that was throwing me. vb Code:
And this part (above) is the other piece I was really struggling with. I like the way you made the WshShell.Run command work. I am understanding most of what is coded here. What it does and how it works. I am however, at a loss for the 'Left ... ' you have in the strFiles line. What does that do ?? The rest of the stuff below is gibberish at the moment. I have a lot more to read up on before I will understand any of that. Although it looks good. Quote: Last edited by Nilpo : August 12th, 2008 at 06:18 AM. |
|
#4
|
|||||
|
|||||
|
Left is a VBS function that returns the leftmost portion of a string for a given number of characters. I'm using it to strip off an extra + character at the end of the string if filenames. Here's the same code commented. This should help.
vb Code:
Last edited by Nilpo : August 12th, 2008 at 06:18 AM. |
|
#5
|
|||
|
|||
|
Ahhh, very nice indeed. Thank you Nilpo.
I can think of what I want, (basically what you had put down in the code), but I can't get it onto paper yet. Thank you very much for the instruction. |
|
#6
|
||||
|
||||
|
Quote:
|