簡體   English   中英

bat 文件沒有運行 an.exe 應用程序?

[英]bat file not running an .exe application?

我正在嘗試從 bat 文件運行應用程序“VolumeReconstructor.exe”,但出現錯誤

'VolumeReconstructor.exe' is not recognized as an internal or external command, operable program or batch file.

代碼如下:

echo off

::Folder path
set location=D:\pigs_december\Converted_Data\test_data\

::File names
set config_file=PlusConfiguration_mysequence.xml
set image_file=TrackedImageSequence_20191207_172327_ICE_3D_Cubes_Intervall_0_1008.nrrd
::set mask_file=mask.png
::set output_file=Output.nrrd

:: Path to the VolumeReconstructor.exe (PlusTookit --> bin)
cd C:\Users\kristjan\PlusApp-2.9.0.20200316-Win64\bin\

:: with mask, but it does not work
::VolumeReconstructor.exe --config-file=%location%\%config_file% --source-seq-file=%location%\%image_file% --output-volume-file=%location%\%output_file% --importance-mask-file=%location%\%mask_file% --image-to-reference-transform=ImageToReference --verbose=4
VolumeReconstructor.exe --config-file=%location%\%config_file% --source-seq-file=%location%\%image_file% --output-volume-file=%location%\%output_file% --image-to-reference-transform=ImageToReference --verbose=4

pause

我究竟做錯了什么?

也許您目前不在c:驅動器上。 你需要這樣做:

:: Path to the VolumeReconstructor.exe (PlusTookit --> bin)
cd /d C:\Users\kristjan\PlusApp-2.9.0.20200316-Win64\bin\

:: with mask, but it does not work
::VolumeReconstructor.exe --config-file=%location%\%config_file% --source-seq-file=%location%\%image_file% --output-volume-file=%location%\%output_file% --importance-mask-file=%location%\%mask_file% --image-to-reference-transform=ImageToReference --verbose=4
VolumeReconstructor.exe --config-file=%location%\%config_file% --source-seq-file=%location%\%image_file% --output-volume-file=%location%\%output_file% --image-to-reference-transform=ImageToReference --verbose=4

但我可能會建議使用這樣的絕對路徑:

:: Path to the VolumeReconstructor.exe (PlusTookit --> bin)
:: don't bother to cd to the directory
:: cd C:\Users\kristjan\PlusApp-2.9.0.20200316-Win64\bin\

:: with mask, but it does not work
::VolumeReconstructor.exe --config-file=%location%\%config_file% --source-seq-file=%location%\%image_file% --output-volume-file=%location%\%output_file% --importance-mask-file=%location%\%mask_file% --image-to-reference-transform=ImageToReference --verbose=4
"C:\Users\kristjan\PlusApp-2.9.0.20200316-Win64\bin\VolumeReconstructor.exe" --config-file=%location%\%config_file% --source-seq-file=%location%\%image_file% --output-volume-file=%location%\%output_file% --image-to-reference-transform=ImageToReference --verbose=4

如果您更改任何內容以包含空格,您可能還需要雙引號所有這些文件位置以供將來兼容:

:: Path to the VolumeReconstructor.exe (PlusTookit --> bin)
:: don't bother to cd to the directory
:: cd C:\Users\kristjan\PlusApp-2.9.0.20200316-Win64\bin\

:: with mask, but it does not work
::VolumeReconstructor.exe --config-file=%location%\%config_file% --source-seq-file=%location%\%image_file% --output-volume-file=%location%\%output_file% --importance-mask-file=%location%\%mask_file% --image-to-reference-transform=ImageToReference --verbose=4
"C:\Users\kristjan\PlusApp-2.9.0.20200316-Win64\bin\VolumeReconstructor.exe" --config-file="%location%\%config_file%" --source-seq-file="%location%\%image_file%" --output-volume-file="%location%\%output_file%" --image-to-reference-transform=ImageToReference --verbose=4

否則我不得不質疑該文件是否實際上在該目錄中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM