put -delete file contents of a folder but keep the folder

Advertisement

buckswope
Joined:
Posts:
1

put -delete file contents of a folder but keep the folder

My goal is to automate the upload of contents of a local folder to an FTP folder and then delete the contents of the local folder (but not the folder itself)
I'm running this command:
put -delete C:\Users\timday\Documents\TEST\ /TEST
And it works, except it also deletes the folder itself.

Is there any way to upload then delete the files within the folder but not the folder?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,286
Location:
Prague, Czechia

Re: put -delete file contents of a folder but keep the folder

Are you referring to the folder TEST? Or to some subfolders of it.
If to the folder itself, adding * to the end of the path should fix it.
Actually, you should be getting a warning suggesting that:
Selecting files using a path ending with slash is ambiguous. Remove the slash to select the folder. Append * mask to select all files in the folder.
(I do, when I try your script)

Reply with quote

Advertisement

You can post new topics in this forum