Windows 如果我键入命令,我总是以cmd而不是commands获取自述文件

Windows 如果我键入命令,我总是以cmd而不是commands获取自述文件,windows,batch-file,cmd,Windows,Batch File,Cmd,我试图在Windows中制作一个程序,每当你键入“commands”或其他内容时,它总是显示自述文件。没有别的了。 我曾尝试在cmd文件中的命令中添加引号,但仍然不起作用。我使用的是Windows8.1x64 Prototype.cmd: @echo off set version=1.0.0 ALPHA title Prototype version %version% echo Welcome to Prototype! echo You have to change the User Di

我试图在Windows中制作一个程序,每当你键入“commands”或其他内容时,它总是显示自述文件。没有别的了。 我曾尝试在cmd文件中的命令中添加引号,但仍然不起作用。我使用的是Windows8.1x64

Prototype.cmd:

@echo off
set version=1.0.0 ALPHA
title Prototype version %version%
echo Welcome to Prototype!
echo You have to change the User Directory in the command file to your username.
timeout 1 > NUL
IF NOT EXIST C:\Users\OldBo-5\Desktop\Prototype\System GOTO SYSTEMNOTFOUND
timeout 5 > NUL
cls
:PrototypeMain
echo Type "commands" to get a list of commands.
echo Type "README" to get the readme text file.
timeout 1 > NUL
set /p cmd=">"
cd C:\Users\OldBo-5\Desktop\Prototype\System\Commands
if %cmd% == "readme" goto :ReadmeCmd
:ReadmeCmd
notepad C:\Users\OldBo-5\Desktop\Prototype\READ ME.text
cls
goto PrototypeMain
if %cmd% == "commands" goto :HelpCmd
:HelpCmd
cls
echo "COMMANDS" - Shows this.
echo "README" - Shows readme.text
timeout 10 > NUL
goto PrototypeMain
:SYSTEMNOTFOUND
cls
title Error starting Prototype.
echo Error starting Prototype. Error Code: 4 - System directory not found. Output error log to ROOT\ErrorLog.text
echo Did you forget to install?
echo To open, right click and click Edit. Select Notepad.
cd C:\Users\OldBo-5\Desktop\Prototype\
type NUL > ErrorLog.text
echo Prototype failed to boot. Error Code: 4 > ErrorLog.text
echo Reason: Error Code 4 means that the system directory could not be found. >> ErrorLog.text
timeout 5 > NUL
exit
这对你有帮助吗

@Echo Off
Set "version=1.0.0 ALPHA"
Title Prototype version %version%
CD /D "%UserProfile%\Desktop\Prototype" 2>NUL||Exit /B
Echo Welcome to Prototype!
Timeout 1 >NUL
If Not Exist "System\" GoTo SYSTEMNOTFOUND

:PrototypeMain
ClS
Set "cmnd="
Echo To get a list of commands type COMMANDS 
Echo To get the ReadMe text file type README
Set /P "cmnd=>"
If /I "%cmnd%" == "readme" (
    Notepad "READ ME.text"
) Else If /I "%cmnd%" == "commands" (
    ClS
    Echo COMMANDS - Shows this.
    Echo README - Shows readme.text
    Timeout 10 >NUL
)
GoTo PrototypeMain

:SYSTEMNOTFOUND
ClS
Title Error starting Prototype.
Echo Error starting Prototype. Error Code: 4 - System directory not found. Output error log to ErrorLog.text
Echo Did you forget to install?
(   Echo Prototype failed to boot. Error Code: 4
    Echo Reason: Error Code 4 means that the system directory could not be found.
)>"ErrorLog.text"
Timeout 5 >NUL
Exit /B

提示:如果%cmd%==“自述文件”转到:ReadmeCmd如果
%cmd%
不是
“自述文件”
,则
会做什么?无论如何,它仍会转到自述文件@melpomeneThis绝对不是用来证明你的问题的工具!你听说过双引号吗?因为当文件或目录路径中有空格或某些有毒字符时,你当然需要双引号,例如
notepad“C:\Users\OldBo-5\Desktop\Prototype\READ ME.text”
我觉得你非常不懂批处理文件或它们的语法。一个好的起点可能是。在继续之前,帮自己一个忙,把基本知识记下来。