Delete older files from remote ftp server.

W.E.B
W.E.B used Ask the Experts™
on
Good Day,
Can you please help,
I'm searching for a script (batch, Vbs, PowerShell), to login to a remote ftp, (User Name & Pwd)
delete ,bak files older than XXX days.

I Don't have access to run any scripts on the remote ftp server.
I need to run the script from my computer.

Your help is greatly appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
You can create a .bat file with a command like this:

forfiles /P "\\remotecomputer\Share" /S /M *.bak /D -14 /C "cmd /c del @file"


14 says anything older than 14 days delete.  

Try running the command by itself using command prompt to test

Author

Commented:
Hello,
ERROR: UNC paths (\\machine\share) are not supported.
Press any key to continue . . .

Also
I need to enter the credentials to access the files.

Thanks
Commented:
I found my own solution.
The older files will be deleted at server level.
Thanks for the help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial