存储批处理文件中大型文件 [英] Storing large file within batch file

查看:240
本文介绍了存储批处理文件中大型文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个存储在其中的一个或多个大型文件为base64 EN codeD字符串一个批处理文件,然后将它们转换回文件。我一直在关注这个问题的第一个答案:内存储文件一个批处理文件?但我想存储该批处理文件中的一个〜3MB的文件,当谈到写文件的源回文件(通过回声),批处理文件出现崩溃。我得到一个弹出说'Windows命令处理器已停止工作。

I'm trying to create a batch file that stores one or more large files within it as base64 encoded strings, then converts them back into files. I've been following the first answer on this question: Store a file inside of a batch file? but i'm trying to store a ~3mb file within this batch file, and when it comes to writing the files source back to a file (via echo), the batch file appears to crash. I get a popup saying 'Windows Command Processor has stopped working'.

有没有数据的批处理文件,多少可以写入到文件中一气呵成的限制?

Is there a limit to how much data batch files can write to a file in one go?

我已经正确地跟着例如,只有改变file.tmp名filetest.tmp,但大约有47000行此批处理文件(这可能是什么原因引起的崩溃)。

I've followed the example correctly, only changing the file.tmp name to filetest.tmp, but there are around 47,000 lines in this batch file (which is probably what's causing it to crash).

如何解决这个问题的任何想法?

Any idea on how to get around this?

编辑:certutil的EN codeD的原始文件相当快,所以我认为这部分不是问题。

certutil encoded the original files quite fast, so I assume that part is not the issue.

推荐答案

我建议你查看我的二进制到批量编码程序的最后一个版本:的 BinToBat.bat ;它具有这种类型的编码的一系列非常有用的功能。这是帮助屏幕:

I suggest you to review the last version of my Binary to Batch encoding program: BinToBat.bat; it have a series of very useful features for this type of encoding. This is the help screen:

Create an installer Batch program for data files of any type

BINTOBAT [/T:.ext1.ext2...] [/L:lineSize] [/F[:fileSize]] filename ...

  /T:.ext1.ext2    Specify the extensions of text type files that will not be
                   encoded as hexadecimal digits, but preserved as text.
  /L:lineSize      Specify the size of output lines (default: 78).
  /F[:fileSize]    /F switch specify to generate a Full installer file.
                   The optional fileSize specify the maximum output file size.

BinToBat encode the given data files as hexadecimal digits (or preserve they
as compressed text) and insert they into InstallFiles.bat program; when this
program run, it generates the original data files.

You may rename the InstallFiles.bat program as you wish, but preserving the
"Install" prefix is suggested.

You may use wild-cards in the filename list.

If the /F switch is not given, a Partial installer is created:
- You may insert a short description for each file.
- You may insert divisions in the file listing via a dash in the parameters.
- The installer allows to select which files will be downloaded and ask
  before overwrite existent files.

If the /F switch is given, a Full installer is created:
- The installer always download all files.
- You may specify commands that will be executed after the files were copied.
- You may specify the maximum size of the output file via /F:fileFize, so in
  this case the output file will be divided in parts with a numeric postfix.

  If you use /F switch you can NOT rename the InstallFiles??.bat files; the
  first one is the installer and the rest just contain data.

此项目已与15 MB大小的文件,这是恩在合理的时间(8-9分钟)codeD,甚至更快的提取试验成功。当然,这些时间取决于所使用的计算机上。

This program has been successfully tested with files of 15 MB size, that are encoded in a reasonable time (8-9 minutes) and extracted even faster. Of course, these times depends on the computer used.

这篇关于存储批处理文件中大型文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆