Page 1 of 1

Find total number of file to be recovered

Posted: 21 Oct 2013, 17:22
by codekingmaker
Hello All,

I need to find total number of file to be recovered from an USB drive. I am trying to get standard output method but it's not working. It throws an error, "The requested operation requires elevation".


ProcessStartInfo objStartInfo = new ProcessStartInfo("Photo_Rec.exe");
objStartInfo.Arguments = "/d D:\\ProgramFile\\Recover\\recagent /cmd usb options,mode_ext2,fileopt,everything,disable,jpg,enable,png,enable,bmp,enable,gif,enable,doc,enable,pdf,enable,txt,enable,mp3,enable,mov,enable,freespace,search";
try
{
Process objRecoverProcess = new Process();
objStartInfo.RedirectStandardError = true;
objStartInfo.RedirectStandardOutput = true;
objStartInfo.UseShellExecute = false;
objRecoverProcess = Process.Start(objStartInfo);
StreamReader adbOutput = objRecoverProcess.StandardOutput;
objRecoverProcess.WaitForExit();
}
catch
{
}

I have used the above code.

Anybody let me know the mistake in this code?

Thanks,

Damu

Re: Find total number of file to be recovered

Posted: 26 Oct 2013, 17:14
by cgrenier
Run "photorec_win.exe /log", photorec.log file is generated, it will contain the number of file recovered.