批量编码启动命令错误

时间:2014-05-07 22:29:27

标签: windows batch-file

我正在尝试创建一个简单的批处理文件来打开我的torrent程序,但每次输入1,2或3进行选择时,它将打开一个标题为文件位置的命令提示符。到目前为止,这是我的文件:

title Torrent Hub
@echo off
:MAIN
color F0
echo.
cls
echo Enter the corresponding number to open the following programs.
echo 1.) PeerBlock
echo 2.) BitTorrent
echo 2.) Both

set /p input=
if %input%==1 goto PEERBLOCK
if %input%==2 goto BITTORRENT
if %input%==3 goto BOTH

:PEERBLOCK
cls
echo Opening PeerBlock...
start "C:\Program Files\PeerBlock\peerblock.exe"
timeout /t 5 >nul
goto CLOSE

:BITTORRENT
cls
echo Opening BitTorrent
start "C:\Users\User\AppData\Roaming\BitTorrent\BitTorrent.exe"
timeout /t 5 >nul
goto CLOSE
:BOTH
cls
echo Opening PeerBlock...
start start "C:\Program Files\PeerBlock\peerblock.exe"
timeout /t 2 >nul
echo Opening BitTorrent...
start "C:\Users\User\AppData\Roaming\BitTorrent\BitTorrent.exe"
timeout /t 5 >nul
goto CLOSE

:CLOSE
end

谢谢你提前! ☺

1 个答案:

答案 0 :(得分:1)

尝试:

start "Loading BitTorrent" "C:\Users\User\AppData\Roaming\BitTorrent\BitTorrent.exe"

start "" "C:\Users\User\AppData\Roaming\BitTorrent\BitTorrent.exe"

而第一个参数是窗口的标题。