cmd.exe / script language
-
Does anybody know of any docs on the cmd.exe shell? Official (MS) as well as non-official. -- Stukas! Stukas im Visier!
-
Does anybody know of any docs on the cmd.exe shell? Official (MS) as well as non-official. -- Stukas! Stukas im Visier!
help cmd
-
help cmd
That doesn't give me much on the actual script language. Mostly cmd.exe switches and how to enable completion. -- Stukas! Stukas im Visier!
-
That doesn't give me much on the actual script language. Mostly cmd.exe switches and how to enable completion. -- Stukas! Stukas im Visier!
Sorry, I thought it did - I guess I only skim-read it :-O Just typing
help
lists the commands that thehelp
program knows about. Of coursehelp
knows about itself:C:\>help help
Provides help information for Windows XP commands.HELP [command]
command - displays help information on that command.
You probably want to look at least at
help if
andhelp goto
. -
Sorry, I thought it did - I guess I only skim-read it :-O Just typing
help
lists the commands that thehelp
program knows about. Of coursehelp
knows about itself:C:\>help help
Provides help information for Windows XP commands.HELP [command]
command - displays help information on that command.
You probably want to look at least at
help if
andhelp goto
.And
help for
,help call
andhelp exit
as well. It's actually a surprisingly capable little language these days. Here's the contents of the which.cmd file in my tools path:@echo off
setlocal enableextensionsif "%1" == "" (
echo usage: which ^<command^>
exit /b 1
)if "%~x1" == "" (
call :pathext %1 %PATHEXT%
) else (
call :search %1
)if %ERRORLEVEL% neq 0 echo %1 not found.
exit /b %ERRORLEVEL%:pathext
:loop
call :search %1%2
if %ERRORLEVEL% equ 0 exit /b 0
shift /2
if not "%2" == "" goto loop
exit /b 1:search
if not "%~f$PATH:1" == "" (
echo %~f$PATH:1
exit /b 0
) else (
exit /b 1
)-- -Blake (com/bcdev/blake)
-
And
help for
,help call
andhelp exit
as well. It's actually a surprisingly capable little language these days. Here's the contents of the which.cmd file in my tools path:@echo off
setlocal enableextensionsif "%1" == "" (
echo usage: which ^<command^>
exit /b 1
)if "%~x1" == "" (
call :pathext %1 %PATHEXT%
) else (
call :search %1
)if %ERRORLEVEL% neq 0 echo %1 not found.
exit /b %ERRORLEVEL%:pathext
:loop
call :search %1%2
if %ERRORLEVEL% equ 0 exit /b 0
shift /2
if not "%2" == "" goto loop
exit /b 1:search
if not "%~f$PATH:1" == "" (
echo %~f$PATH:1
exit /b 0
) else (
exit /b 1
)-- -Blake (com/bcdev/blake)
:omg::wtf: Ah yes, I see from
help call
that the parameter syntax has been extended to support different parameter expansions, and also to allow essentially a subroutine call into the same batch file. Cunning use of the%PATHEXT%
variable, there. I must copy this to my Windows 2000 computer - the Platform SDK'swhere
now requires Windows XP. -
:omg::wtf: Ah yes, I see from
help call
that the parameter syntax has been extended to support different parameter expansions, and also to allow essentially a subroutine call into the same batch file. Cunning use of the%PATHEXT%
variable, there. I must copy this to my Windows 2000 computer - the Platform SDK'swhere
now requires Windows XP.Heh, good catch. It was exactly due to where.exe being broken that I wrote it. -- -Blake (com/bcdev/blake)