problems with process.start methode
-
Hi, What if you try:
System.Diagnostics.Process.Start("C:\\Program Files\\Acrobate\\Reader 8.0\\AcroRd32.exe", "\"C:\\sourcedir\\somefile.pdf\"");
Mika
is there a difference in mering it to one string or to seperate it with a comma?? and is there a chance to get it start with the parameters and the printer this way?
-
is there a difference in mering it to one string or to seperate it with a comma?? and is there a chance to get it start with the parameters and the printer this way?
-
Just wondering is there a typo. Should there be folder Reader after Reader 8.0? Take a look at the paths you posted
C:\Program Files\Acrobate\Reader 8.0\Reader\AcroRd32.exe
C:\\Program Files\\Acrobate\\Reader 8.0\\AcroRd32.exeyeap, this is a typo, sorry. the correct path is C:\\Program Files\\Acrobate\\Reader 8.0\\AcroRd32.exe in every example.
-
yeap, this is a typo, sorry. the correct path is C:\\Program Files\\Acrobate\\Reader 8.0\\AcroRd32.exe in every example.
-
nope, it's just a typo in here!
-
nope, it's just a typo in here!
Ok, next steps could be: - any info in stack of the exception - is the exception type of Win32Exception One possibility is usage rights as you mentioned. You could try to move the pdf to another place (for example temp where you would not have problems with rights) Another thing is that is it possible that Acrobat is actually giving the error and it's only reported through .net framework. I may be totally off the track at this time of the day (1 AM local time) and need to get some sleep, but I'll check on this again tomorrow Mika
-
yeap, this is a typo, sorry. the correct path is C:\\Program Files\\Acrobate\\Reader 8.0\\AcroRd32.exe in every example.
Acrobat really has the "e" on the end on your system? This worked fine for me:
System.Diagnostics.Process.Start("\"C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe\"", "");
Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Acrobat really has the "e" on the end on your system? This worked fine for me:
System.Diagnostics.Process.Start("\"C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe\"", "");
Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Mark Salsbery wrote:
Acrobat really has the "e" on the end on your system?
Aaaahhh, so that's why the 'methode' was not working. :doh:
-
Mark Salsbery wrote:
Acrobat really has the "e" on the end on your system?
Aaaahhh, so that's why the 'methode' was not working. :doh:
it's just a typo. should have been adobe instead of acrobat :( sorry. if there are typos in the dirinfo then please ignore them. it's not the reason, because i copied the directory info from the file explorer to visual studio, so this info is correct. i guess when typing it here i mixed it up. so the correct path should be System.Diagnostics.Process.Start("\"C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe\"", "\"C:\\sourcedir\\somefile.pdf\"");
-
it's just a typo. should have been adobe instead of acrobat :( sorry. if there are typos in the dirinfo then please ignore them. it's not the reason, because i copied the directory info from the file explorer to visual studio, so this info is correct. i guess when typing it here i mixed it up. so the correct path should be System.Diagnostics.Process.Start("\"C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe\"", "\"C:\\sourcedir\\somefile.pdf\"");
So is it working now? :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
it's just a typo. should have been adobe instead of acrobat :( sorry. if there are typos in the dirinfo then please ignore them. it's not the reason, because i copied the directory info from the file explorer to visual studio, so this info is correct. i guess when typing it here i mixed it up. so the correct path should be System.Diagnostics.Process.Start("\"C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe\"", "\"C:\\sourcedir\\somefile.pdf\"");
You could test one thing just in case: - define both parameters as string and assign them - put the string to clipboard - paste the text to command prompt and execute it If the pdf is opening, it's clear that the command is valid. For example:
string filename = "\"C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe\"";
string arguments = "\"C:\\sourcedir\\somefile.pdf\"";
Clipboard.Clear();
Clipboard.SetText(filename + " " + arguments);
System.Diagnostics.Process.Start(filename, arguments);
//paste to command prompt and executeMika