473,662 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Diagnost ics.Process.Sta rt( 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.Diagnost ics.Process.Sta rt("c:\\windows \\system32\\not epad.exe","c:\\ x.txt"); work fine
Nov 16 '05 #1
5 7771
Can you post the code for Process.Start?

ShaneB

"mg" <mg@discussions .microsoft.com> wrote in message
news:6D******** *************** ***********@mic rosoft.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.Diagnost ics.Process.Sta rt( 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.Diagnost ics.Process.Sta rt("c:\\windows \\system32\\not epad.exe","c:\\ x.txt");
work fine

Nov 16 '05 #2
mg
System.Diagnost ics.Process.Sta rt("c:\\progra m files\\adobe\\a crobat
6.0\\reader\\ac rord32.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******** *************** ***********@mic rosoft.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.Diagnost ics.Process.Sta rt( 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.Diagnost ics.Process.Sta rt("c:\\windows \\system32\\not epad.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:\exportfile s\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******** *************** ***********@mic rosoft.com...
System.Diagnost ics.Process.Sta rt("c:\\progra m files\\adobe\\a crobat
6.0\\reader\\ac rord32.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******** *************** ***********@mic rosoft.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.Diagnost ics.Process.Sta rt( 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.Diagnost ics.Process.Sta rt("c:\\windows \\system32\\not epad.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:\exportfile s\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******** *************** ***********@mic rosoft.com...
System.Diagnost ics.Process.Sta rt("c:\\progra m files\\adobe\\a crobat
6.0\\reader\\ac rord32.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******** *************** ***********@mic rosoft.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.Diagnost ics.Process.Sta rt( 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.Diagnost ics.Process.Sta rt("c:\\windows \\system32\\not epad.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:\exportfile s\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******** *************** ***********@mic rosoft.com...
System.Diagnost ics.Process.Sta rt("c:\\progra m files\\adobe\\a crobat
6.0\\reader\\ac rord32.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******** *************** ***********@mic rosoft.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.Diagnost ics.Process.Sta rt( 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.Diagnost ics.Process.Sta rt("c:\\windows \\system32\\not epad.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
1975
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 works to run DTSRun from the command line without typing in the directory as c:\program files\microsoft sql server\80\tools\binn is in the 'path' environmen variable, so it can be found What is the equivalent in C# of VB.NET's Shell, given that...
6
3073
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" "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 run in the code behind of a Visual Studio WebForm
3
3080
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 MSDE setup works fine from a CMD prompt... anyone know of articles or known issues with this technique, and what are my alternatives to having my user install several "Commandline parameter intensive" setups to get this installed? :) MTIA wardeaux
0
1896
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 any print dialog then once the printing's done... restore the original Header and footer but here's what happens: - save the current header and footer
2
1756
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 intervention. Thanks, Phil
0
2246
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 with the "print"-verb. This works for me. However, I need to handle the case when a printing application doesnt't quit in a given timespan (for example a password-protected word-document). So I've tried the following:
0
7199
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 1.1 framework, but discovered that when I used Process.Start() the user's credentials were not impersonated, it just kept using the asp.net's user, so I switched the webservice over to 2.0 as Diagnostics.Process.StartInfo now has username,...
0
6693
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 (1.1 does not support running a process as a different user). I'm running everything on Windows Server 2003. I have impersonation enabled in my web.config, and I'm using Integrated authentication on the IIS virtual directory that this aspx is in....
7
13049
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 the command line phone number, MyDialer is run but of course without the necessary command line. Appreciate some help. Ed
2
12185
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 Object , fill its StartInfo and then go a process.Start(), It works fine, unless i try to execute the process with another user. Why, what do i have to take care of,...i gt the 267 Win32Exception Code with the Exception thrown,...
0
8344
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8764
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8546
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.