2012-04-14 35 views
0

我想從一個bat文件運行一個exe文件。 錯誤是彈出的初始錯誤類型未知。 遊戲運行良好,由它自己。但是想用bat文件。/ 這是什麼原因造成的?我已經花了3天,沒有關於初始化錯誤類型未知 谷歌雅虎Dogpile甚至webferret 我沒有檢查所有的註冊表網站,以確保我的設置是正確的蝙蝠文件。蝙蝠和通訊,文件。初始化錯誤嘗試啓動一個exe文件

@echo off 
    START "" "C:\01Game\1aedit\1aedit.exe" "-i" 
    rem start /wait C:\01Game\1aedit\1aedit.exe 
    pause 
    if not errorlevel 0 goto :ERR1 
    goto :STEP2 
    :STEP2 

    START "" "..\2atop\2atop.exe" "-i" 
    rem start /wait C:\01Game\2atop\2atop.exe 
    pause 
    if not errorlevel 0 goto :ERR2 
    goto :ALLOK 
    :ERR1 
    echo **** Warning: file1 did not work properly! **** 
    echo. 
    echo Press any key to terminate job ... 
    pause>nul 
    goto :END 
    :ERR2 
    echo **** Warning: file2 did not work properly! **** 
    echo. 
    echo Press any key to terminate job ... 
    pause>nul 
    goto :END 
    :ALLOK 
    echo ****** Job completed successfully ***** 
    echo. 
    goto :END 
    :END 
    EXIT /B 
+0

什麼是「-i」。它是您的程序參數還是START命令的參數? – Steve 2012-04-14 08:08:46

+0

當你說遊戲運行良好時,它意味着什麼?你如何直接或使用快捷方式('.lnk')文件而不使用批處理文件來調用可執行文件?作爲一個瘋狂的猜測,嘗試去除''-i「'周圍的雙引號。 – 2012-04-14 09:11:25

+0

Andriy M,我被告知「-i」。 - 如何打開bat文件並且不打開命令窗口。 – 2012-04-15 05:43:14

回答

0

好吧我想我找到了問題,但是我不知道如何解決它。

的exe文件是C:\ 01Game \ 1aedit \ 1aedit.exe 並從

C,則需要的文件:\ 01Game \ 1aedit \文件\音頻

C:\ 01Game \ 1aedit \文件\紋理這裏有12個文件夾。

因此,我怎麼添加 「工作目錄」,以 啓動/等待C:\ 01Game \ 1aedit \ 1aedit.exe

0

我想,你只需要CD到你的情況workung目錄。

cd /d C:\01Game\1aedit\files\audio 
start /wait C:\01Game\1aedit\1aedit.exe 

Btw。我看不到start /waitC:\01Game\1aedit\1aedit.exe也應該沒有它的原因。

+0

嗯,我需要14個文件運行每個獨立的文件夾,每個文件夾與其他14個文件夾像這樣,C:\ 01Game \ 1aedit \ 1aedit.exe然後子文件夾C:\ 01Game \ 1aedit \ Files C:\ 01Game \ 1aedit \ Files \ audiobank – 2012-04-15 17:53:59

+0

那麼我需要14個文件來運行每個獨立的文件夾,每個文件夾與其他14個文件夾像這樣,C:\ 01Game \ 1aedit \ 1aedit.exe然後子文件夾C:\ 01Game \ 1aedit \ Files C:\ 01Game \ 1aedit \ Files \ audiobank C:\ 01Game \ 1aedit \ Files \ textures C:\ 01Game \ 1aedit \ Files \ mesh C:\ 01Game \ 1aedit \ Files \ script anb等等,它們都是遊戲,每個需要訪問它自己的文件。所以我需要告訴bat文件每個遊戲工作目錄在哪裏。隨着每個關卡的完成,一個接一個地循環運行遊戲。非常感謝 – 2012-04-15 18:00:51