Fix for windows ftp filling up c: drive space

Windows ftp can fill up C: drive. This happens either putting or getting files, even if you try putting/getting them to a drive other than C:.

This happens because the ftp file is written to temporary area first by ftp, and moved to the final location at the very end.

The solution is to set temp directories to another drive which has a lot of free space, e.g.:

set TEMP=D:\junk
set TMP=D:\junk

If running ftp from command prompt and getting large files, then just run those commands in the command window before starting ftp.

Otherwise set those as control panel environment variables.

A similar issue can happen with the oracle installer in windows, where it uses TEMP and TMP to unpack a significant amount of temporary installer files. Same fix in that case.

March 13, 2009

  • Hi – I have some important ftp processes that are now failing because the C drive has too little free space. Setting the local environment variables makes no difference! Nor does resetting the System environment variables TMP and TEMP. My test case shows the changed environment variables before calling ftp – but still the scratch file is in c:\Windows\Temp. (yes, rebooted server succesfully after asserting new values for system env varibles). I’m testing in WS 2003 Standard Edition SP2. I’m open to all suggestions. Are there other ftp clients where it is known the scratch file will be on the same partition as the target path, or can be redirected? Thank you for any help – Alan

  • Hi Alan,

    That’s strange, it did work for me ok – and I see same fix said to work – also WS 2003 SP2, albeit EE rather than SE – in the comments at

    Reboots shouldn’t be necessary, but you could double check your settings have taken effect in the command window before you start ftp with “set temp” and “set tmp”. And obviously be careful you’re not working in the C: drive when starting ftp, or use ftp’s “lcd” command to move out of C: before the get – maybe do both if there is any room for doubt such as when running this from scheduled task. And I prefer to keep things simple in ftp with ‘cd’ first followed by ‘get filename’ without any directory/folder prefixes in front of the filename.

    All the alternative FTP programs for Windows I know of are interactive GUIs, good for one off use but not for scheduled tasks.

    Microsoft support might be needed if nothing else works.

  • Hi Thanks a lot for the Post, thjis worked for me sucessfully..
    First I set the TMP varibales in cmd prompt and from same cmd prompt I have ran the FTP cmd…It works fine….

  • Damned Windows, it loves to do stupid things.

    Thanks for your hint, it works !

  • Leave a Reply

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