the syntax of the command is incorrect.

December 8, 2011 at 07:16:16
Specs: Windows 7
I am getting this error when trying to call a nested function:

-------------------------
goto label1

:label1
call :label2
-------------------------

or even when moving the nested function code into the calling function:

-------------------------
goto label1

:label1
for /f %%m in ('type filename') do (
command1
command2
)

-------------------------

Any help would be appreciated.


See More: the syntax of the command is incorrect.

Report •


#1
December 8, 2011 at 09:14:38
Issue not clear; code works as posted:
H:\>copy con a.cmd
@echo off
goto label1

:label1
call :label2

:label2
echo Hi^Z
        1 file(s) copied.

H:\>a
Hi
Hi

How To Ask Questions The Smart Way


Report •

#2
December 9, 2011 at 08:49:04
Realized today I had a parenthesis problem! Thanks!

Report •

Related Solutions


Ask Question