1

I would like to know if there is a way to run a command prompt program such as "C:/temp/mactimes.pl" which the command "perl mactimes.pl" could be run in the C# program.

I have looked through "process.start" class but it only detects .exe format programs. Therefore I need the "perl" command to startup the perl script.

Please do give advices! Thanks!!!

JavaNoob
  • 3,494
  • 19
  • 49
  • 61
  • Oh, I am sorry for providing you with a wrong answer. While searching for a solution I came across an article Make Your Existing Perl Apps .NET-compliant http://www.devx.com/dotnet/Article/8015/1954 .I will let you know if i find a concrete answer. – Searock Nov 15 '10 at 05:11

2 Answers2

4

If perl is in the system PATH:

Process.Start("perl.exe", "C:\\temp\\mactimes.pl");

Otherwise you will need to enter the full path to it.

  • Does not seem to work gives me an error of "system cannot find file specified". I tried running the command purely on the CMD and it works.... – JavaNoob Nov 11 '10 at 07:22
  • In that case, I said to specify the full path to the perl executable. Your code might look like this: Process.Start("C:\\perl\\bin\\perl.exe", "C:\\temp\\mactimes.pl"); –  Nov 11 '10 at 17:10
0

Try to use "cmd.exe" as the executable. And feed it with anything you want after "/C" key for example.