Windows: Enable cmd command extensions

Hi,

to check if command extensions are enabled check the following registry key

c:\> reg query "HKEY_CURRENT_USER\Software\Microsoft\Command Processor"  /v EnableExtensions
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
    EnableExtensions    REG_DWORD    0x1
C:> reg query "HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor"  /v EnableExtensions
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor
    EnableExtensions    REG_DWORD    0x1

To enable command extensions for a cmd process start it with parameter E:ON

C:> cmd.exe /E:ON

or within a batch file

SETLOCAL EnableExtensions

Further batch improvements: If you run batch files from a UNC Path cmd generates a warning that the working folder cannot be a UNC path: “Invalid current directory path. UNC paths are not supported. Defaulting to Windows directory”. But when you are sure that your commands/applications supports UNC pathes as working directory you can suppress this by setting

c:\> reg add "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DisableUNCCheck /d 1 /t REG_DWORD

Michael

Advertisment to support michlstechblog.info

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.