@echo off
title ex
setlocal
if not "%~1" == "/?" goto :endif
for %%t in (
"This is the command shell for Omega Kernel."
"Please credit if used elsewhere."
"commands:"
""
" /g GOTO"
" The g command essentially works as CD in CMD."
""
" /d delete directory"
" The d command is none other than rd/rmdir in cmd."
""
" /mk MAKE (Directory)"
" mk is just a replacement of mkdir/md."
""
" /mv MOVE"
" mv Moves something somewhere. that's all folks."
""
" /c COPY"
" cp copies something somewhere, letting you add variables"
""
" /va EXPORT FROM VIRTUAL ARCHIVE"
" va exports files from the virtual archive of the server."
" how does it work? It downloads the virtual archive, unzips it, copies the file and then deletes the archive."
""
" /win Opens CMD."
""
" /update downloads updated tools."
""
""
""
"Developed by DaviAwesome, 2012"
""
"2018 -Ninjight_"
) do echo;%%~t
exit /b
:endif
if /i not "%~1" == "/g" goto :endif
set /p "input=Where to go? "
cd /d %input%
exit /b
:endif
::delete folder
if /i not "%~1" == "/d" goto :endif
set /p "rminput=What to remove? "
rd %rminput%
exit /b
:endif
::make folder
if /i not "%~1" == "/mk" goto :endif
set /p "mkinput=Where? "
md %mkinput%
exit /b
:endif
::move
if /i not "%~1" == "/mv" goto :endif
set /p "mvinput=What to move? "
set /p "mvinput2=Where to? "
move %mvinput% %mvinput2%
exit /b
:endif
::copy.
if /i not "%~1" == "/c" goto :endif
set /p "copyinput0=Copy with? "
set /p "copyinput=What to copy? "
set /p "copyinput2=Where to? "
set /p "copyinput3=Variables? "
if "%copyinput0%" == "xc" (
xcopy %copyinput% %copyinput2% %copyinput3%
)
if "%copyinput0%" == "robo" (
robocopy %copyinput% %copyinput2% %copyinput3%
)
if "%copyinput0%" == "c" (
copy %copyinput% %copyinput2% %copyinput3%
)
exit /b
:endif
::virtual archive
if /i not "%~1" == "/va" goto :endif
set /p "archinput=What to export? "
set /p "archinput2=Where to? "
download http://link.suffix/file.extension file.extension
move file.extension .\folder\
exit /b
:endif
::open cmd
if /i not "%~1" == "/win" goto :endif
cmd
exit /b
:endif
::update command replaces the old and outdated UP.bat
if /i not "%~1" == "/update" goto :endif
download http://link.suffix/file.extension file.extension
move file.extension .\tools\folder
exit /b
:endif
Корпуса []
изменены на ""
.
Дважды заключите в кавычки некоторые строки и переменные, которые могут в них нуждаться.
Отрицайте множество if
сравнений, чтобы использовать goto :endif
вместо использования скобок.
Это позволяет %variables%
расширяться без необходимости
задержка расширения, не заключенная в скобки.
Удалены устаревшие метки :xe
, :c
и :robo
в качестве
теперь используется отключенный код.