2013-10-13 34 views
1

我正在寫一個批處理腳本,我稱之爲我寫處理某個文件的一個matlab函數 它在更簡單的情況下工作正常,但是當我添加for/r和通過它給我批處理腳本在添加for/r循環後停止工作

The syntax of the command is in correct pointing to the first line calling the matlab 

我評論該行現在同樣的錯誤指向啓動命令 我知道這可能是一些簡單的我失蹤,但我想不出我的錯誤的參數

C:\Cygwin64\bin\bash "/cygdrive/f/database/sfs1.sh" & 
for /r F:\database\trimmed %%A in (*.txt) do (
    echo %%~dpnxA 
    matlab /nosplash /minimize /nodesktop /r "editEnergyfile('%%~dpnxA')";quit & 
:loop 
    tasklist /fi "imagename eq matlab.exe" | C:\windows\system32\find /i /n ":" > nul 
    if errorlevel 1 goto loop 
    start "" /b /wait /separate proc_eng_track.exe "%%~dpnA" & 
    matlab /nosplash /minimize /nodesktop /r "Sail_speechrate('%%~dpnA')";quit 
) 
+1

想通了只需要刪除幾個& – mhmsa

+0

你可以請你發佈你的糾正命令作爲答案 - 爲recored? – Shai

回答

0

備案現在的代碼工作,不給任何語法錯誤

::echo off 
C:\Cygwin64\bin\bash "/cygdrive/f/database/sfs1.sh" 
for /r F:\database\trimmed %%G in (*.txt) do (
    echo %%~dpnxG 
    matlab /wait /nosplash /minimize /nodesktop /r "editEnergyfile('%%~dpnxG')";quit 
    :loop 
    tasklist /fi "imagename eq matlab.exe" | C:\windows\system32\find /i /n ":" > nul 
    if errorlevel 1 goto loop 
    start "" /b /wait /separate proc_eng_track.exe "%%~dpnG" 
    matlab /nosplash /minimize /nodesktop /r "Sail_speechrate('%%~dpnG')";quit 
) 

現在的問題是,它不會一直擴大在過去的幾行 的參數,所以有時它給了我

start "" /b /wait /separate proc_eng_track.exe "%~dpnG" 

該文件無法打開沒有這樣的文件或目錄

+0

刪除了循環,現在一切正常,這是好的,因爲我已經等待調用matlab命令 – mhmsa