As extensões de comando estão desativadas por algum motivo. As extensões de comando envolvem alterações sérias nos argumentos da Linha de Comando (Parâmetros) , como por CALL /?
.
No entanto, o próximo trecho de CMD /?
mostra algumas dicas de solução:
Command Extensions are enabled by default. You may also disable extensions for a particular invocation by using the
/E:OFF
switch. You can enable or disable extensions for all invocations ofCMD.EXE
on a machine and/or user logon session by setting either or both of the followingREG_DWORD
values in the registry usingREGEDIT.EXE
:HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions
and/or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions
to either
0x1
or0x0
. The user specific setting takes precedence over the machine setting. The command line switches take precedence over the registry settings.In a batch file, the
SETLOCAL ENABLEEXTENSIONS
orDISABLEEXTENSIONS
arguments takes precedence over the/E:ON
or/E:OFF
switch. SeeSETLOCAL /?
for details.
Exemplo
==>type D:\bat\cliParser.bat
@echo OFF >NUL
echo all %%* = %*
set /A "ii=0"
:loopfor
echo param %%%ii% = %0
SHIFT
set /A "ii+=1"
if not [%0]==[] goto :loopfor
goto :eof
==>D:\bat\cliParser.bat aaa bbb
all %* = aaa bbb
param %0 = D:\bat\cliParser.bat
param %1 = aaa
param %2 = bbb
==>cmd /E:OFF /C D:\bat\cliParser.bat aaa bbb
all %* = *
The syntax of the command is incorrect.
param %3 = D:\bat\cliParser.bat
The syntax of the command is incorrect.
param %3 = aaa
The syntax of the command is incorrect.
param %3 = bbb
The syntax of the command is incorrect.
The system cannot find the batch label specified - eof
==>