473,657 Members | 2,445 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 run 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 18 '05 #1
6 3072
You want to run this on the Server? Do you get an error? Define "have not
been able"

Jeff
"mg" <mg@discussions .microsoft.com> wrote in message
news:58******** *************** ***********@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 run 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 18 '05 #2
mg
> You want to run this on the Server?

Yes. But for now I'd be happy to get it running on my desktop using Visual
Studio .NET
Do you get an error?

Yes:
Unhandled exception at 0x65697265 in AcroRd32.exe: 0xC0000005: Access
violation reading location 0x65697265.
Define "have not been able"
The file x.pdf is not printed.
"Jeff Dillon" wrote:
You want to run this on the Server? Do you get an error? Define "have not
been able"

Jeff
"mg" <mg@discussions .microsoft.com> wrote in message
news:58******** *************** ***********@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 run 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 18 '05 #3
Show the exact code that you are using, and I'll try it here.

Just so you know, clients will be printing on the server via this technique,
not from their desktop. How does the paper then get from the printer near
the server, to the client sitting at their desk?

Jeff

"mg" <mg@discussions .microsoft.com> wrote in message
news:9E******** *************** ***********@mic rosoft.com...
You want to run this on the Server?


Yes. But for now I'd be happy to get it running on my desktop using Visual
Studio .NET
Do you get an error?
Yes:
Unhandled exception at 0x65697265 in AcroRd32.exe: 0xC0000005: Access
violation reading location 0x65697265.
Define "have not been able"


The file x.pdf is not printed.
"Jeff Dillon" wrote:
You want to run this on the Server? Do you get an error? Define "have

not been able"

Jeff
"mg" <mg@discussions .microsoft.com> wrote in message
news:58******** *************** ***********@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 run 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 18 '05 #4
mg
Show the exact code that you are using, and I'll try it here.
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' 'DOT4_001'");
How does the paper then get from the printer near the server, to the client sitting at their desk?

It doesn't. This code prints the pdf file on a printer named HP LaserJet
3300 Series PCL 6 (or any other printer name I choose)

=============== ========

Unless you know how to give the ASP.NET worker process the permissions
(that's a whole nother story), this code won't actually print. But, if this
code were to run without error at your site, chances are it would also print
here, where the ASP.NET worker process has the permissions it needs to do so.

It appears

"Jeff Dillon" wrote:
Show the exact code that you are using, and I'll try it here.

Just so you know, clients will be printing on the server via this technique,
not from their desktop. How does the paper then get from the printer near
the server, to the client sitting at their desk?

Jeff

"mg" <mg@discussions .microsoft.com> wrote in message
news:9E******** *************** ***********@mic rosoft.com... You want to run this on the Server?


Yes. But for now I'd be happy to get it running on my desktop using Visual
Studio .NET
> Do you get an error?


Yes:
Unhandled exception at 0x65697265 in AcroRd32.exe: 0xC0000005: Access
violation reading location 0x65697265.
Define "have not been able"


The file x.pdf is not printed.
"Jeff Dillon" wrote:
You want to run this on the Server? Do you get an error? Define "have not been able"

Jeff
"mg" <mg@discussions .microsoft.com> wrote in message
news:58******** *************** ***********@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 run 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 18 '05 #5
No, not any printer you choose. It must be defined within the context of the
user account running it, AND on the machine it's running from! It would
have to be listed under Printers in Control Panel on the server the ASP.NET
page is being served up from.

You can have the ASP.NET process run under any account you choose. I have
one test site running here under my admin account. As long as I specify a
pre-configured printer in your parameter list, it will print (on/from the
server, not at the client)

Jeff

"mg" <mg@discussions .microsoft.com> wrote in message
news:9E******** *************** ***********@mic rosoft.com...
Show the exact code that you are using, and I'll try it here.
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' 'DOT4_001'");
How does the paper then get from the printer near the server, to the client sitting at their desk?

It doesn't. This code prints the pdf file on a printer named HP LaserJet
3300 Series PCL 6 (or any other printer name I choose)

=============== ========

Unless you know how to give the ASP.NET worker process the permissions
(that's a whole nother story), this code won't actually print. But, if this code were to run without error at your site, chances are it would also print here, where the ASP.NET worker process has the permissions it needs to do so.
It appears

"Jeff Dillon" wrote:
Show the exact code that you are using, and I'll try it here.

Just so you know, clients will be printing on the server via this technique, not from their desktop. How does the paper then get from the printer near the server, to the client sitting at their desk?

Jeff

"mg" <mg@discussions .microsoft.com> wrote in message
news:9E******** *************** ***********@mic rosoft.com...
> You want to run this on the Server?

Yes. But for now I'd be happy to get it running on my desktop using
Visual Studio .NET

>> Do you get an error?

Yes:
Unhandled exception at 0x65697265 in AcroRd32.exe: 0xC0000005: Access
violation reading location 0x65697265.

> Define "have not been able"

The file x.pdf is not printed.
"Jeff Dillon" wrote:

> You want to run this on the Server? Do you get an error? Define "have not
> been able"
>
> Jeff
> "mg" <mg@discussions .microsoft.com> wrote in message
> news:58******** *************** ***********@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 run
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 18 '05 #6
I have the problem to to start an application from within a web
application too.
The application is started (I can see it in task manager) but the
window is hidden. I think the ASPNET user has not the permission to
"interact with the desktop". The only way I could start an application
on the server is to change the username attribut in <processmodel > in
machine.config to "SYSTEM".
You wrote, that you gave asp.net all permissions to start e.g.
notepad. Can you please tell me, how you did that?

Thanks, Uli
"mg" <mg@discussions .microsoft.com> wrote in message news:<58******* *************** ************@mi crosoft.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 run 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 18 '05 #7

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

Similar topics

15
1974
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...
5
7771
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 runnning this line in the code behind of a Visual Studio WebForm
3
3079
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
7198
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
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
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
8732
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...
0
8605
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...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
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
4155
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...
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.