.cmd VS .bat for WinXP batch file

Discussion in 'Computer Support' started by Jack B. Pollack, May 2, 2004.

  1. Is there any advantage in giving WinXP batch file a .cmd extension as
    opposed to a .bat extension?

    TIA
     
    Jack B. Pollack, May 2, 2004
    #1
    1. Advertisements

  2. Jack B. Pollack

    Unk Guest

    Helps if you run more than one OS.

    bat files work on all Windows platforms.
    cmd files only work on Win2k, NT, and XP
     
    Unk, May 2, 2004
    #2
    1. Advertisements

  3. Jack B. Pollack

    why? Guest

    Depends if you need to use the any newer extensions / env variables, the
    main bit below is for 2000 similar applies to XP, I expect..

    I havent tried for a while, but may the extension triggers command or
    cmd shell. Can't remember as I do all my NT class stuff as .cmd by
    default.

    On Win2000 command -
    Microsoft(R) Windows DOS
    (C)Copyright Microsoft Corp 1990-1999.


    and cmd
    Microsoft Windows 2000 [Version 5.00.2195]
    (C) Copyright 1985-2000 Microsoft Corp.





    Windows Server 2003
    Frequently Asked Questions Regarding The Windows 2000 Command
    ProcessorFrom: Jerold Schulman, Windows Server MVP - Author of Tips &
    Tricks.
    Newsgroups: Microsoft.Public.Win2000.cmdprompt.admin
    Subject: FAQs about the Windows 2000 Command Processor.
    Date: July 15, 2002

    What is the Windows 2000 Command Processor?
    Answer: Windows 2000 supports two (2) command processors:

    - COMMAND.COM is the command processor for the virtual DOS Machine
    (VDM), used for processing MS-DOS based applications and scripts.

    - CMD.EXE is the native 32-bit command processor, used to open a command
    prompt and to press batch (.bat) files.

    This FAQ addresses CMD.EXE. If you need help troubleshooting 16-bit
    applications, see Microsoft Knowledge Base articles:



    What environment variables are available to CMD.EXE?
    Answer: In addition to the environment variables that are defined using
    Control Panel / System / Advanced / Environment Variables, Windows 2000
    has some built-in variables. To see the environment variables that are
    available, type SET.

    Note The built-in variables are different if you log on locally versus
    log on to a domain. Notice that %LOGONSERVER% contains the validating
    domain controller.

    Windows 2000 also defines some hidden environment variables that you can
    use:



    different article -
    On computers running Microsoft Windows XP or later, the maximum length
    of the string that you can use at the command prompt is 8191 characters.
    On computers running Microsoft Windows 2000 or Windows NT 4.0, the
    maximum length of the string that you can use at the command prompt is
    2047 characters.


    Me
     
    why?, May 2, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.