Logon Script Extension

Does anybody know what the difference is between a logon script that would end in .bat and one that ends in .cmd?

Who is Participating?
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
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 http://www.petri.co.il/forums/showthread.php?t=15026&goto=#8
Farhan KaziSystems EngineerCommented:
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.)
Brian PiercePhotographerCommented:
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 http://www.computerworld.com/blogs/node/2948
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Correction: when I said "32-bit VHD" it should be "32-bit command shell"
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.