
我有這行程式碼:
@echo off
rem set the path to the Spek executable
set spek=C:\Program Files (x86)\Spek\spek.exe
rem set the path to the audio files
set audio_path=P:\Muzyka\complete\Album
rem loop through all audio files in the specified directory
for %%a in (%audio_path%\*.mp3) do (
rem open the audio file in a new Spek window
start "" %spek% "%%a"
)
我想打開該資料夾中的 2 首歌曲,為什麼它不起作用?
答案1
您應該spek
用雙引號分隔變數的值,因為路徑中包含空格:
set spek="C:\Program Files (x86)\Spek\spek.exe"
我測試了修改後的.bat文件,它可以工作!