I am using System.Diagnostics.Process in a Windows service application. The application that I call uses DropBox API and Google Drive API. When I login on Google Drive or DropBox it is supposed to open the Web browser and allow access to Drop or Drive, but it doesn't open it. Other functions works properly (create folder on local computer, read files, write logfiles etc).
When I open this application manually with double click, the login process works properly, the web browser is shown and I can allow access.
Something similar happens with other application using Saraff Twain. If I open it manually it works properly, I can scan and save files (on this process some alerts or message box are shown, like a "scanning", "no paper", "no scanner" messages) but when the windows service call it no messages are shown, it scans and save files but without messages.
If I call this application from another windows form or console application the applications works properly.
I don't know what is the problem with the Windows service.
Thanks for your help.
Here is the code that I used in the Windows service app (here it fails), and Windows forms app (here it works fine). I have tried calling CMD.exe and application path as argument, and directly the path on file name.
p.StartInfo.UseShellExecute = false;
p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/C" + " \"" + execName+"\" " + argument;
//p.StartInfo.Verb = "runas";
// writeLogLine(argument + " " + execName);
p.Start();
output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
writeLogLine("out" + output);