我有一個目錄中有子目錄,我試圖將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