Thanks to Vineel who gave me this code.
Use the code at your risk, code start from the next line. Copy paste the code into a notepad and change the file name to something.vbs
Function SplitFile(FileName)
'Create Stream object
Dim BinaryInStream
Dim BinaryOutStream
Set BinaryInStream = CreateObject("ADODB.Stream")
BinaryInStream.Type = 1
BinaryInStream.Open
BinaryInStream.LoadFromFile "c:\1.avi"
i=0
WHILE NOT BinaryInStream.EOS
buf = BinaryInStream.Read (5242880) ' 5MB => mention the size of each splited file in bytes
Set BinaryOutStream = CreateObject("ADODB.Stream")
BinaryOutStream.Type = 1
BinaryOutStream.Open
BinaryOutStream.Write(buf)
BinaryOutStream.SetEOS
BinaryOutStream.SaveToFile "C:\" & i & ".dat" , 2
BinaryOutStream.Close
WScript.Echo i & ".dat"
i = i + 1
WEND
BinaryInStream.Close
End Function
'here u give the binary file path
'splited files will be created in C:\ drive......check above logic.....
SplitFile("c:\notepad.exe")
'use following command to recombine them ......... /B means binary files
'copy /B 0.dat+1.dat+2.dat+3.dat+4.dat+5.dat+6.dat+7.dat+8.dat+9.dat+10.dat+11.dat+12.dat+13.dat test.exe
'by vineel
Use the code at your risk, code start from the next line. Copy paste the code into a notepad and change the file name to something.vbs
Function SplitFile(FileName)
'Create Stream object
Dim BinaryInStream
Dim BinaryOutStream
Set BinaryInStream = CreateObject("ADODB.Stream")
BinaryInStream.Type = 1
BinaryInStream.Open
BinaryInStream.LoadFromFile "c:\1.avi"
i=0
WHILE NOT BinaryInStream.EOS
buf = BinaryInStream.Read (5242880) ' 5MB => mention the size of each splited file in bytes
Set BinaryOutStream = CreateObject("ADODB.Stream")
BinaryOutStream.Type = 1
BinaryOutStream.Open
BinaryOutStream.Write(buf)
BinaryOutStream.SetEOS
BinaryOutStream.SaveToFile "C:\" & i & ".dat" , 2
BinaryOutStream.Close
WScript.Echo i & ".dat"
i = i + 1
WEND
BinaryInStream.Close
End Function
'here u give the binary file path
'splited files will be created in C:\ drive......check above logic.....
SplitFile("c:\notepad.exe")
'use following command to recombine them ......... /B means binary files
'copy /B 0.dat+1.dat+2.dat+3.dat+4.dat+5.dat+6.dat+7.dat+8.dat+9.dat+10.dat+11.dat+12.dat+13.dat test.exe
'by vineel
Hello friends,
ReplyDeleteThe code will read any large file and split it into smaller chuncks so you can copy to stiffy,e-mail or ftp it. This code is for you out there playing with file management etc. It will leave the source file and will create a bunch of smaller files in the same directory. This code can be modified to output directly to the stiffy drive if you want. Thanks a lot.....
Scrape Web Pages