I need to run a console application within the execute method of a timer job in SharePoint 2010. Please guide me to do this by providing samples or links or hints.

  • 2
    A console app doesn't seem like the right solution.could you explain a bit about what you are trying to do – Anders Rask Nov 30 '11 at 6:57

Not sure why you would want to run an external application from a SharePoint timer job, however, you could try using the Process() class in C# (this isn't a SharePoint-specific example, but is how you launch external processes from .NET code):

Process pr = new Process(); 
pr.StartInfo.FileName = "Notepad.exe"; 
pr.StartInfo.Arguments = "test.dat"; 
while (pr.HasExited == false)
     if ((DateTime.Now.Second % 5) == 0)
     { // Show a tick every five seconds.

Sample from: http://omegacoder.com/?p=119

I'm not sure if SharePoint will allow this, but it's worth a shot.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.