• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

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
0
sanju_scaria_ee
Asked:
sanju_scaria_ee
  • 3
  • 3
  • 2
1 Solution
 
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
Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now