Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. cmd.exe / script language

cmd.exe / script language

Scheduled Pinned Locked Moved System Admin
linuxtoolsquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jorgen Sigvardsson
    wrote on last edited by
    #1

    Does anybody know of any docs on the cmd.exe shell? Official (MS) as well as non-official. -- Stukas! Stukas im Visier!

    M 1 Reply Last reply
    0
    • J Jorgen Sigvardsson

      Does anybody know of any docs on the cmd.exe shell? Official (MS) as well as non-official. -- Stukas! Stukas im Visier!

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      help cmd

      J 1 Reply Last reply
      0
      • M Mike Dimmick

        help cmd

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        That doesn't give me much on the actual script language. Mostly cmd.exe switches and how to enable completion. -- Stukas! Stukas im Visier!

        M 1 Reply Last reply
        0
        • J Jorgen Sigvardsson

          That doesn't give me much on the actual script language. Mostly cmd.exe switches and how to enable completion. -- Stukas! Stukas im Visier!

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          Sorry, I thought it did - I guess I only skim-read it :-O Just typing help lists the commands that the help program knows about. Of course help 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 and help goto.

          B 1 Reply Last reply
          0
          • M Mike Dimmick

            Sorry, I thought it did - I guess I only skim-read it :-O Just typing help lists the commands that the help program knows about. Of course help 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 and help goto.

            B Offline
            B Offline
            Blake Coverett
            wrote on last edited by
            #5

            And help for, help call and help 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 enableextensions

            if "%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)

            M 1 Reply Last reply
            0
            • B Blake Coverett

              And help for, help call and help 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 enableextensions

              if "%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)

              M Offline
              M Offline
              Mike Dimmick
              wrote on last edited by
              #6

              :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's where now requires Windows XP.

              B 1 Reply Last reply
              0
              • M Mike Dimmick

                :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's where now requires Windows XP.

                B Offline
                B Offline
                Blake Coverett
                wrote on last edited by
                #7

                Heh, good catch. It was exactly due to where.exe being broken that I wrote it. -- -Blake (com/bcdev/blake)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups