Batch file 我可以获得批处理项目的帮助吗?

Batch file 我可以获得批处理项目的帮助吗?,batch-file,Batch File,免责声明:(我知道我的标题不是很有描述性。因为我甚至不知道错误发生在哪里,所以我没有太多的东西可以放在那里) 所以,我试图写一个无用的脚本来浪费时间,结果我完全投入其中。它本来是用来制作某种便携式垃圾文件的 代码如下: @echo off if not EXIST trash goto create if EXIST trash goto exists :create mkdir trash goto end :exists echo Would you like to delete t

免责声明:(我知道我的标题不是很有描述性。因为我甚至不知道错误发生在哪里,所以我没有太多的东西可以放在那里)

所以,我试图写一个无用的脚本来浪费时间,结果我完全投入其中。它本来是用来制作某种便携式垃圾文件的

代码如下:

@echo off


if not EXIST trash goto create
if EXIST trash goto exists

:create
mkdir trash
goto end

:exists
echo Would you like to delete the files inside of the trash? (y/n)
set /p YESNO=" "
if %YESNO%==n goto end
if %YESNO%==y goto check

:check
echo Please state the correct password
set /p PASSWORD = " "
if %PASSWORD%==1243 del trash\*.* /s /f /q
pause

:end
在我输入密码后的检查中,它只是结束,没有错误消息,并且不会删除垃圾箱文件夹中的文件。

这有帮助吗

@Echo Off
If Exist "trash\" GoTo exists

:create
(MD "trash" 2>NUL || Echo Failed to create trash!) & GoTo :EOF

:exists
%SystemRoot%\System32\choice.exe /M "Would you like to empty the trash"
If ErrorLevel 2 GoTo :EOF

:check
Set /P "password=Please enter the correct password>"
If "%password%" == "1243" PushD "trash" && RD /S /Q . 2>NUL & Echo Done! & PopD

Pause