IFTP, current directory, open new connection

Charles Dye

Super Moderator
Staff member
May 20, 2008
Albuquerque, NM
I was having trouble the other day with a batch file which uploads files to multiple servers. The script opens a connection to server A with IFTP, sets the current directory with CD FTP:, copies files, and then closes the connection with IFTP /C, then repeats the process with server B. The problem is that when opening a new connection to server B, IFTP attempts to set the current directory to the remembered current directory from server A. Unless the same directory exists on both, this doesn't work, and IFTP fails with an error message.

I tried adding a forward slash to the end of the IFTP parameters string, but for reasons I don't understand that didn't help. I was able to work around the problem by adding a CD FTP:/ before the IFTP /C.

I think this situation might be better handled in one of two ways:

1. (simple) When closing a connection with IFTP /C, always reset the current directory to the root.

2. (complicated) When opening a connection with IFTP, if there was a previous connection, compare server names. If the name of the server being opened does not match the server name of the prior connection, reset the CWD to the root.
Similar threads
Thread starter Title Forum Replies Date
cgunhouse Problems With IFTP Support 3
vefatica IFTP and SFTP Support 7
vefatica WAD IFTP timeout? Support 3
B when doing SFTP via IFTP to my secure site my users always get the finger print key prompt Support 1
S iftp copying pgp files from ftp is not working Support 11
cgunhouse IFTP "/S" Option Support 6
vefatica WAD IFTP - old problem still there Support 2
cgunhouse IFTP Path Issue in V17 - Fixed Support 7
vefatica IFTP and active FTP Support 13
vefatica Both IFTP problems remain in build 50 Support 35
vefatica More on IFTP Support 7
vefatica IFTP problems (broken pipe?) Support 24
cgunhouse Foldermonitor and iftp Support 1
Charles Dye Minor nit: DIR /F, IFTP, colorization Support 4
D iftp problem Support 2
D iftp failure after upgrading to build 65 Support 9
S FTP site; IFTP access Support 10
K iftp script copy deletes target files Support 17
J Problems with FTP after IFTP timeout Support 2
P iftp with ftp proxy Support 0
J IFTP issue Support 1
nikbackm IFTP questions Support 3
D "534 Fallback to [C]" after iftp Support 7
Joe Caverly How to? Get name of current LIBRARY function? Support 4
R How to? Open Take Command at current folder Support 7
R CMDebug, dark theme, current line Support 7
R How to? Obtain current colors Support 2
K copy changing destination current directory Support 1
A Installer /extract: extracts into current directory if target not exists Support 12
scottb How to? ipconfig output in current window Support 4
vefatica TCMD's current directory? Support 4
vefatica Update to current install dir? Support 8
Allen TCC 17 Beta - current functionality? Support 5
M Hotkey-mechanism, for doing something with the current command-line Support 4
S DESKTOP - identify current active ? Support 4
A How to? Copy current directory to clipboard Support 9
R How to? Is there a way to see current directories in all drives? Support 11
M How to? A very simple question re. the current line number in a batch file... Support 2
daniel347x How to get Take Command to read in all current system environment variables that CMD.EXE sees? Support 13
D Extracting the current command line, extracting current path Support 4
J Utility to Save/Restore current screen Support 16
fishman@panix.com HELP!! I just updated to Version 28 and as usual I cannot make extended directory search work. Support 2
D How to use multi-line DO to loop through first level directory names Support 5
D ParentDirectory does not update directory history Support 6
samintz CDD to non-existent directory hangs Support 2
gworley rd (Remove Directory) gives interesting error: Support 2
D Directory History Window with wildcard search Support 3
D How to? Skip removing directory (RMDIR) without error message Support 2
gentzel Directory stack empty when running TCEXIT? Support 9
vefatica Disable extended directory searches (completely)? Support 8

Similar threads