0

I have been asked to log into a Webserver with a server IP address and administrator password and create a bat file or vb script to run and remove files in subfolders that are dated a month before today's date. This needs to be set up as a scheduled task on the server to run nightly.

How can I do this as I am a new programmer learning out things in my first job? Can anyone help me with this, please.

jhoyla
  • 1,191
  • 1
  • 9
  • 26
  • SO is not generally the place to ask for code. If you show us what you have tried, we will try and help. If you provided more information about the web-server you are connecting to, and tell us what has / has not worked we will endeavour to at least point you in the right direction. – jhoyla Aug 13 '12 at 15:54
  • I am asked to write a windows batch file which can automatically delete files and folders older than 30 days from FTP server's outbox. – sallyperil Aug 13 '12 at 18:37

1 Answers1

0

After a brief (one search) I found the following question on SO: Batch file to delete files older than N days.

I'd recommend using this answer.

In future, perhaps search to see if someone else has asked the same / a very similar question to you before asking.

So in your case you would want

forfiles -p "C:\what\ever" -s -m *.* -d "-30" -c "cmd /c del @path"

Please remember to accept this answer if it answers your question.

Community
  • 1
  • 1
jhoyla
  • 1,191
  • 1
  • 9
  • 26