kindly let me know how to write a windows service for deleting WS-FTP.log files

Hi,
kindly let me know how to write a windows service in c# for deleting WS-FTP.log files. this service has to run at a fixed time interval. Please give me the code snippet also.

thanks in advance..
sanju
sanju_scaria_eeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ivo StoykovCommented:
where you'll run this service - through IIS or OS service.

you might use just at tool to do the job

I
0
sanju_scaria_eeAuthor Commented:
I dont have much idea about windows services.. and where or how to run it..

if you can give me a suggestion, i would appreciate it a lot.

thank you..
0
TolomirAdministratorCommented:
Is there any reason not to use windows tasks service.

Create a simple batch file. Add it to windows tasks run it once per night and you are done...
0
Challenges in Government Cyber Security

Has cyber security been a challenge in your government organization? Are you looking to improve your government's network security? Learn more about how to improve your government organization's security by viewing our on-demand webinar!

TolomirAdministratorCommented:
To remove all files in a folder older than 3 days create a batchfile like this


(Remove txt from attached deloldfiles.vbs.txt)
cscript deloldfiles.vbs c:\dba\log 3
rem It deletes files older than 3 days

Open in new window

deloldfiles.vbs.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ivo StoykovCommented:
Hi sanju_scaria_ee
Just create a bat (cmd) file with contents
delete disk:\path_to_files\file_names.ext
Then open you schedule tasks and create new task with this bat file.
Set timout and you're done.
you do not need any code (exept quoted above) neither services nor anything else.
HTH
I
0
TolomirAdministratorCommented:
This is how to setup a windows task:

http://www.iopus.com/guides/winscheduler.htm
0
sanju_scaria_eeAuthor Commented:
Hi Tolomir,
this was realy a good solution.. thank you so much..
sanju..
0
sanju_scaria_eeAuthor Commented:
Hi Guys,
Thank you all so much for your responses.
they were all realy helpful.

Thanks
sanju..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.