Logon Script Extension

Posted on 2007-09-29
Last Modified: 2008-05-31
Does anybody know what the difference is between a logon script that would end in .bat and one that ends in .cmd?

Question by:andrewjones1987
    LVL 26

    Assisted Solution

    No difference in behavior. .BAT extensions are executed in a 16bit VDM (mean executed by the old 16-bit command processor)while .CMD extensions are executed in a 32bit (executed by the new 32-bit cmd processor) VDM. This has implications for scripts that may need to access shared memory from other processes or applications.

    (The CMD extension is limited to newer Windows systems and is not recognized in Windows 9x/Me systems.)
    LVL 70

    Expert Comment

    You also need to be a bit careful when scripting - if you can do something in a BAT file you can do it in a CMD file but the opposite is not awlays true - see
    LVL 18

    Accepted Solution

    Actually there is a difference in behavior and by default both .bat and .cmd are executed in the 32-bit VMD (cmd.exe) not 16-bit (command.exe).
    Have a look at posts 8 and 9 in this thread
    LVL 18

    Expert Comment

    by:Jeremy Weisinger
    Correction: when I said "32-bit VHD" it should be "32-bit command shell"

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Installing a printer using group policy preferences is not that hard let’s take a look at it. First lets open up your group policy console and edit the policy you want to add it to. I recommend creating a new policy for each printer makes it a l…
    Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now