我试图制作一个简单的批处理文件来打开我的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

谢谢是前进! ☺

最佳答案

尝试:

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

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

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

关于windows - 批处理编码开始命令错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23529608/

10-13 08:10