473,808 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with ProcessStartInf o

I have the code below. It will open and print the pdf file (test.pdf) to the
printer.

ProcessStartInf o startInfo = new ProcessStartInf o();
startInfo.UseSh ellExecute = true;
startInfo.Verb = "Print";
startInfo.Creat eNoWindow = true;
startInfo.Windo wStyle = ProcessWindowSt yle.Minimized;
startInfo.FileN ame = @"E:\\barcode\t est.pdf";
Process p = new Process();
p.StartInfo = startInfo;
p.Start();

It works well on my local test machine. Once I copied it to the server, it
will not print or open the pdf file.
Anybody can help?
Jun 27 '08 #1
2 3154
on the server there is no profile setup for asp.net (on you dev box it runs
as you). this means no default printer. you will need to specify the printer.

-- bruce (sqlwork.com)
"Michelle Mabelle" wrote:
I have the code below. It will open and print the pdf file (test.pdf) to the
printer.

ProcessStartInf o startInfo = new ProcessStartInf o();
startInfo.UseSh ellExecute = true;
startInfo.Verb = "Print";
startInfo.Creat eNoWindow = true;
startInfo.Windo wStyle = ProcessWindowSt yle.Minimized;
startInfo.FileN ame = @"E:\\barcode\t est.pdf";
Process p = new Process();
p.StartInfo = startInfo;
p.Start();

It works well on my local test machine. Once I copied it to the server, it
will not print or open the pdf file.
Anybody can help?
Jun 27 '08 #2
Thank you Bruce!
I am not sure how to setup profile for asp.net...
Also, I specified printer on another part of the code as below:

ProcessStartInf o startInfo = new ProcessStartInf o();
startInfo.UseSh ellExecute = true;
startInfo.Verb = "Printto";
startInfo.Argum ents = @"\\UTzhangM\Ze braTLP";
startInfo.Creat eNoWindow = true;
startInfo.Windo wStyle = ProcessWindowSt yle.Minimized;
startInfo.FileN ame = @"E:\\barcode\t est.pdf";
Process p = new Process();
p.StartInfo = startInfo;
p.Start();
"bruce barker" wrote:
on the server there is no profile setup for asp.net (on you dev box it runs
as you). this means no default printer. you will need to specify the printer.

-- bruce (sqlwork.com)
"Michelle Mabelle" wrote:
I have the code below. It will open and print the pdf file (test.pdf) to the
printer.

ProcessStartInf o startInfo = new ProcessStartInf o();
startInfo.UseSh ellExecute = true;
startInfo.Verb = "Print";
startInfo.Creat eNoWindow = true;
startInfo.Windo wStyle = ProcessWindowSt yle.Minimized;
startInfo.FileN ame = @"E:\\barcode\t est.pdf";
Process p = new Process();
p.StartInfo = startInfo;
p.Start();

It works well on my local test machine. Once I copied it to the server, it
will not print or open the pdf file.
Anybody can help?
Jun 27 '08 #3

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

Similar topics

0
1556
by: Stedak | last post by:
My application seems to freeze when Microsoft Office Document Imaging is set as the default for loading images. If the Windows Picture and Fax Viewer is used there is no problem. When I set a break point then the Document Imaging will appear after I restart the application or if I just kill the app it appears. I am working with TIF's. Any thoughts as to what I need to do to enable the use of Microsoft Office Document Imaging? If I...
0
1323
by: Matt | last post by:
I am running a exe from command line in my application and when I use ProcessStartInfo it seems to duplicate all the commands within the function. for instance I write a file. Without my ProcessStartInfo the file I write does what it is supposed to do and writes 1 file. With ProcessStartInfo it writes two files it even creates the random ListName for the file twice (different numbers). When I go look at it through the debug process...
0
2279
by: Leo Heska | last post by:
Hi I haven't seen the following problem mentioned anywhere We have an application written in VB.NET which executes a batch file (named startJob.cmd). We have discovered that if that batch file is too big, the last lines of the batch file will not run. For example, the following one-line batch file runs just fine when invoked from our VB.NET app echo %PATH% > c:\com\molex\plot\wmIntegration\logs\p0.lo but the following batch file...
0
4298
by: ALI-R | last post by:
I am using the code below to open Outlook as user clicks on "Email this page" try { string subjectEmail=string.Format("Magnet Alert Center - Alerts for : {0}",Request.QueryString);
7
7015
by: WALDO | last post by:
I wrote a console application that basically consumes arguments and starts other command line apps via System.Process. Let's call it XCompile for now. I wrote a Visual basic add-in that does pretty much the same thing to XCompile. Let's call it MyAddin. XCompile collects information to send to vbc.exe. When it comes across any arguments that are file paths, it wraps them in quotes. For example: Dim prms As String
1
5834
by: Philip Wagenaar | last post by:
How do I set the string "myPass" for ProcessStartInfo.Password? Dim instance As ProcessStartInfo instance.Password "myPass" 'This is no good because its System.Security.String instance.UserName = "myUser"
2
9832
by: Bala Nagarajan | last post by:
Hello, I am having issues when i use the Systsem.Diagnostics.Process namespace to start a process. The problem is that i am able to succeed in starting a process (an exe) only few times in a row from a windows application before it fails throwing the following exception. (The exe i am trying to run is in the same directory as the application.) System.ComponentModel.Win32Exception The system cannot find the file specified...
1
2657
by: sunny | last post by:
Hi all We have a pdf user manual which we open when client clicks on help button. some of our clients have the issue that it does not open the file and it says file not found. checked with istaller and everything. i wonder why it would do so?? please help out code to run the adobe reader: ProcessStartInfo startInfo = new ProcessStartInfo(AcrobatReader, Filename)
4
20166
by: melisa | last post by:
I'm writting a method which will start a new specified program and specified file e.g start testdoc.doc with WINWORD.exe as below: private void Start_Process() { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "WINWORD.exe"; startInfo.Arguments = @"c:\testfolder\testdoc.doc"; Process.Start(startInfo); }
0
9600
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
10631
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
10114
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
7651
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
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
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...
1
4331
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
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
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.