0

Im have to execute the following code.

Dim Info As ProcessStartInfo = New ProcessStartInfo()
Info.Arguments = "/C ping 1.1.1.1 -n 1 -w 3000 > Nul & Del """ & Application.ExecutablePath.ToString & """"    
Info.WindowStyle = ProcessWindowStyle.Hidden
Info.CreateNoWindow = True
Info.FileName = "cmd.exe"
Process.Start(Info)`

The code will delete the file on execution. How can I code my program so the function is called 5 days after first execution.

Thanks in advance.

3
  • maybe windows schedule will call your exe file each 5 days Commented Nov 18, 2014 at 7:11
  • but is there a way to code the program so it keeps track of the date of first execution? Commented Nov 18, 2014 at 7:17
  • using timer and keep your program running all the time Commented Nov 18, 2014 at 7:26

1 Answer 1

0

you might do the following

1- create a windows service application, check this link to get more information Developing Windows Service Applications

2- use timer , check this link to get more information

Windows service and timer

hope this will help you

Sign up to request clarification or add additional context in comments.

2 Comments

@AliHaider i changed the first url for more details
here a sample of how to create a simple windows service using vs2010 codeproject.com/Articles/106742/… , hope it will help you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.