?
Solved

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

Posted on 2008-11-05
8
Medium Priority
?
273 Views
Last Modified: 2013-12-17
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
Comment
Question by:sanju_scaria_ee
  • 3
  • 3
  • 2
8 Comments
 
LVL 22

Expert Comment

by:Ivo Stoykov
ID: 22892957
where you'll run this service - through IIS or OS service.

you might use just at tool to do the job

I
0
 

Author Comment

by:sanju_scaria_ee
ID: 22892977
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
 
LVL 27

Expert Comment

by:Tolomir
ID: 22892992
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
Automating Your MSP Business

The road to profitability.
Delivering superior services is key to ensuring customer satisfaction and the consequent long-term relationships that enable MSPs to lock in predictable, recurring revenue. What's the best way to deliver superior service? One word: automation.

 
LVL 27

Accepted Solution

by:
Tolomir earned 2000 total points
ID: 22893011
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
 
LVL 22

Expert Comment

by:Ivo Stoykov
ID: 22893014
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
 
LVL 27

Expert Comment

by:Tolomir
ID: 22893015
This is how to setup a windows task:

http://www.iopus.com/guides/winscheduler.htm
0
 

Author Closing Comment

by:sanju_scaria_ee
ID: 31513806
Hi Tolomir,
this was realy a good solution.. thank you so much..
sanju..
0
 

Author Comment

by:sanju_scaria_ee
ID: 22895228
Hi Guys,
Thank you all so much for your responses.
they were all realy helpful.

Thanks
sanju..
0

Featured Post

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot has fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Provide an easy one stop to quickly get the relevant information on common asked question on Ransomware in Expert Exchange.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question