473,322 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Printing PDF from Process.Start( , ) without user prompt

mg
The following .exe and its parameters work correctly from the command prompt
(it prints x.pdf without prompting the user.

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"

But, I have not been able to use the exe and its parameters as arguments #1
& #2 in System.Diagnostics.Process.Start( arg1 , arg2) when runnning this
line in the code behind of a Visual Studio WebForm

I have given ASP.NET all permissions, so commands like
System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x.txt"); work fine
Nov 16 '05 #1
5 7749
Can you post the code for Process.Start?

ShaneB

"mg" <mg@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
The following .exe and its parameters work correctly from the command
prompt
(it prints x.pdf without prompting the user.

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"

But, I have not been able to use the exe and its parameters as arguments
#1
& #2 in System.Diagnostics.Process.Start( arg1 , arg2) when runnning
this
line in the code behind of a Visual Studio WebForm

I have given ASP.NET all permissions, so commands like
System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x.txt");
work fine

Nov 16 '05 #2
mg
System.Diagnostics.Process.Start("c:\\program files\\adobe\\acrobat
6.0\\reader\\acrord32.exe",@"/t c:\exportfiles\d.pdf 'HP LaserJet 3300 Series
PCL 6' + 'HP LaserJet 3300 Series PCL 6' + 'DOT4_001'");

BUT THIS DOESN'T WORK!

"ShaneB" wrote:
Can you post the code for Process.Start?

ShaneB

"mg" <mg@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
The following .exe and its parameters work correctly from the command
prompt
(it prints x.pdf without prompting the user.

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"

But, I have not been able to use the exe and its parameters as arguments
#1
& #2 in System.Diagnostics.Process.Start( arg1 , arg2) when runnning
this
line in the code behind of a Visual Studio WebForm

I have given ASP.NET all permissions, so commands like
System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x.txt");
work fine


Nov 16 '05 #3
You're not handling the quotation marks properly. In addition, I removed
the "+" signs because they weren't in your command prompt version...which
you said works. Anyway, the line should be:
@"/t ""c:\exportfiles\x.pdf"" ""HP LaserJet 3300 Series PCL 6"" ""HP
LaserJet 3300 Series PCL 6"" ""DOT4_001""";

This is now equivalent to what you stated in your first post:

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"
I recommend using a MessageBox to test code like this... That way you can
see what the strings will look after all the formatting is done.

ShaneB

"mg" <mg@discussions.microsoft.com> wrote in message
news:A8**********************************@microsof t.com...
System.Diagnostics.Process.Start("c:\\program files\\adobe\\acrobat
6.0\\reader\\acrord32.exe",@"/t c:\exportfiles\d.pdf 'HP LaserJet 3300
Series
PCL 6' + 'HP LaserJet 3300 Series PCL 6' + 'DOT4_001'");

BUT THIS DOESN'T WORK!

"ShaneB" wrote:
Can you post the code for Process.Start?

ShaneB

"mg" <mg@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
> The following .exe and its parameters work correctly from the command
> prompt
> (it prints x.pdf without prompting the user.
>
> acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6"
> "HP
> LaserJet 3300 Series PCL" "DOT4_001"
>
> But, I have not been able to use the exe and its parameters as
> arguments
> #1
> & #2 in System.Diagnostics.Process.Start( arg1 , arg2) when runnning
> this
> line in the code behind of a Visual Studio WebForm
>
> I have given ASP.NET all permissions, so commands like
> System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x.txt");
> work fine
>
>


Nov 16 '05 #4
mg
Your code works! Thank you very much!

"ShaneB" wrote:
You're not handling the quotation marks properly. In addition, I removed
the "+" signs because they weren't in your command prompt version...which
you said works. Anyway, the line should be:
@"/t ""c:\exportfiles\x.pdf"" ""HP LaserJet 3300 Series PCL 6"" ""HP
LaserJet 3300 Series PCL 6"" ""DOT4_001""";

This is now equivalent to what you stated in your first post:

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"
I recommend using a MessageBox to test code like this... That way you can
see what the strings will look after all the formatting is done.

ShaneB

"mg" <mg@discussions.microsoft.com> wrote in message
news:A8**********************************@microsof t.com...
System.Diagnostics.Process.Start("c:\\program files\\adobe\\acrobat
6.0\\reader\\acrord32.exe",@"/t c:\exportfiles\d.pdf 'HP LaserJet 3300
Series
PCL 6' + 'HP LaserJet 3300 Series PCL 6' + 'DOT4_001'");

BUT THIS DOESN'T WORK!

"ShaneB" wrote:
Can you post the code for Process.Start?

ShaneB

"mg" <mg@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
> The following .exe and its parameters work correctly from the command
> prompt
> (it prints x.pdf without prompting the user.
>
> acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6"
> "HP
> LaserJet 3300 Series PCL" "DOT4_001"
>
> But, I have not been able to use the exe and its parameters as
> arguments
> #1
> & #2 in System.Diagnostics.Process.Start( arg1 , arg2) when runnning
> this
> line in the code behind of a Visual Studio WebForm
>
> I have given ASP.NET all permissions, so commands like
> System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x.txt");
> work fine
>
>


Nov 16 '05 #5
mg
Is there a way to replace c:\exportfiles\d.pdf programatically. That is,
substitute another path before running the Start() method at runtime?

"mg" wrote:
Your code works! Thank you very much!

"ShaneB" wrote:
You're not handling the quotation marks properly. In addition, I removed
the "+" signs because they weren't in your command prompt version...which
you said works. Anyway, the line should be:
@"/t ""c:\exportfiles\x.pdf"" ""HP LaserJet 3300 Series PCL 6"" ""HP
LaserJet 3300 Series PCL 6"" ""DOT4_001""";

This is now equivalent to what you stated in your first post:

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"
I recommend using a MessageBox to test code like this... That way you can
see what the strings will look after all the formatting is done.

ShaneB

"mg" <mg@discussions.microsoft.com> wrote in message
news:A8**********************************@microsof t.com...
System.Diagnostics.Process.Start("c:\\program files\\adobe\\acrobat
6.0\\reader\\acrord32.exe",@"/t c:\exportfiles\d.pdf 'HP LaserJet 3300
Series
PCL 6' + 'HP LaserJet 3300 Series PCL 6' + 'DOT4_001'");

BUT THIS DOESN'T WORK!

"ShaneB" wrote:

> Can you post the code for Process.Start?
>
> ShaneB
>
> "mg" <mg@discussions.microsoft.com> wrote in message
> news:6D**********************************@microsof t.com...
> > The following .exe and its parameters work correctly from the command
> > prompt
> > (it prints x.pdf without prompting the user.
> >
> > acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6"
> > "HP
> > LaserJet 3300 Series PCL" "DOT4_001"
> >
> > But, I have not been able to use the exe and its parameters as
> > arguments
> > #1
> > & #2 in System.Diagnostics.Process.Start( arg1 , arg2) when runnning
> > this
> > line in the code behind of a Visual Studio WebForm
> >
> > I have given ASP.NET all permissions, so commands like
> > System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x.txt");
> > work fine
> >
> >
>
>
>


Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: songie D | last post by:
H If I us Process.Start("DTSRun ...") on a computer that has SQL server installed, it can't fin DTSRun, claiming 'file not found'. Despite this, Shell("DTSRun...") from VB.NET works fine It also...
6
by: mg | last post by:
The following .exe and its parameters work correctly from the command prompt (it prints x.pdf without prompting the user. acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6"...
3
by: Wardeaux | last post by:
All, I've written a "setup" wrapper that calls a sequence of "setup.exe", and all works except when I call the setup.exe for the MSDE, then it gets about half way through and then hangs... The...
0
by: LilBuh | last post by:
Hello :) this is a repost... i ve been looking for a way since last week ... i have a template html file that i modify from my code... i need to print this file without IE's Header and Footer or...
2
by: PAPutzback | last post by:
I am trying to decrpyt a gpg encrypted file but the process prompts for a password. The Process.start function is run in a service so I want to be able to pass the password without any user...
0
by: henning.friese | last post by:
Hello NG, I'm need to write some code which creates tiff files from various document types (doc, pdf, xls). I want to do this by ShellExecuting (via System.Diagnostics.Process) the doc-files...
0
by: Paul | last post by:
Hi, I'm trying to kick off the iiscnfg.vbs from a webservice to export a website's config to an xml file (And eventually populate other servers with the config). I initially tried this using the...
0
by: Kirk | last post by:
The following C# web service works fine until you uncomment the lines setting UserName and Password. Then, Process.Start throws an Access is Denied Exception. This is with .NET 2.0, of course...
7
by: Ed Bitzer | last post by:
When I use System.Diagnostics.Process.Start("D:\MyDialer.exe 123 456 1234") attmpting to run a dialer from my program, I get an error 5 "The system cannot fine the file specified" If I eliminate...
2
by: Kerem Gümrükcü | last post by:
Hi, i have a Process.Start call that fails with 267 Error Code if invoked with another user and password other than the applications user. It is a ordinary piece of code just create a Process...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.