Solved FTP BAtch Script : Maximum setlocal recursion level reached.

May 23, 2012 at 01:03:13
Specs: Windows 7
Hi,

When i am trying to do FTP using batch script, it does not end and on cmd screen i can see "Maximum setlocal recursion level reached " which is displayed continuously one after other .

My Script:(this executed OK before but now giving me error.)

@echo off
setlocal enabledelayedexpansion
setlocal enableextensions
if exist _.ftp del _.ftp > nul
(
echo open <my ftp add>
echo <username>
echo <password>
echo cd <my ftp dir path>
echo bin
echo hash
echo prompt
echo mput D:\temp\*.gz
echo bye
) > _.ftp
ftp -s:_.ftp
del _.ftp > nul
pause


See More: FTP BAtch Script : Maximum setlocal recursion level reached.

Report •


#1
May 23, 2012 at 02:29:35
✔ Best Answer
Let me guess, you called the script "ftp.bat". Anyway the script is caught in a recursive loop which pushes setlocal over it's stack limit. The script is calling itself rather that the "ftp" command.

Rename the script to something that isn't a command name.


Report •

#2
May 23, 2012 at 03:14:32
Mind blowing ... You hit right on the target. , solved , Thanks again.

Report •

Related Solutions


Ask Question