tags:

views:

302

answers:

0

Hi Folks, I am looking for a programmatic way to batch resize images from a folder using irfanview command line tool (i_view.exe)

The command works in dos command prompt. But when I try to creare a .NET C# console app to run i_view32.exe as a process, I get Win#2 Exception.

Any clue how can I programmatically use irfanview to manipulate images in a batch?

Here is my code:

     ProcessStartInfo procInfo = new ProcessStartInfo(@"C:\Inetpub\wwwroot\kokil\Bin\i_view32.exe");
     procInfo.WindowStyle = ProcessWindowStyle.Minimized;

     procInfo.UseShellExecute = true;
     Process.Start(procInfo); <--- Gives error saying ivew.exe is NOT a win 32 application
     char chrQuote = '"';
     procInfo.Arguments = @"C:\musa\Challenge\IrfanViewMagic\ujjal\raw\*.*" + chrQuote.ToString() + " /resize=(500,500) /resample /sharpen=20 /jpgq=" + QUALITY + " /aspectratio /convert=" + chrQuote.ToString() + "C:\\musa\\Challenge\\IrfanViewMagic\\ujjal\\test\\*.jpg" + chrQuote.ToString();

     Process.Start(procInfo);

I get exception from Process.Start(procInfo); <--- Gives error saying ivew.exe is NOT a win 32 application

Any clue or other suggestions?

Thanks