我有一个目录中有子目录,我试图将docx转换为html。 到目前为止,我发现这个命令:需要pandoc批处理命令
@ECHO off
:selectfile
:: Clear any preexisting filename variables
SET filename=
:: Ask which file we're converting.
SET /p filename=Which file? (Don't include the .docx file extension):
CALL pandoc -o -s "%filename%".html --self-contained "%filename%".docx
GOTO selectfile
的问题是它的问我的文件名,我必须把这个蝙蝠文件中的每个子文件夹内做的工作。 我想进行一些更改,以便自动检测子文件夹并将所有docx文件转换为具有相同名称的html文件。 这是可能的家伙? 任何人都可以修改此脚本? 非常感谢。
提示:https://stackoverflow.com/documentation/batch-file/3695/for-loops-in-batch -files#t = 201703061006249850917 – DavidPostill
并且请将整个文件名用双引号括起来,而不仅仅是其中的一部分,它强制Windows命令解释器分别启动应用程序的启动代码来修复参数字符串,即使用'“%filename%.html” '和'“%filename%.docx”'。 – Mofi
set filename命令会搞砸了。它的罚款和这样的工作,但不能解决我的问题。 – user3551620