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

Home Posts Topics Members FAQ

ProcessStartInf o duplicating code execution

I am running a exe from command line in my application and when I use
ProcessStartInf o it seems to duplicate all the commands within the function.

for instance I write a file. Without my ProcessStartInf o the file I write
does what it is supposed to do and writes 1 file.

With ProcessStartInf o 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 and step into it, it doesnt
show the code being executed twice.

Any idea whats going on here? Driving me nuts.
Random R =new Random();
int MaxLimit = 5000000;
string ListName = R.Next(MaxLimit ).ToString();
StreamWriter sr = new StreamWriter("C :\\" + ListName + ".txt");
sr.Write(PointD ata);
sr.Close();
ProcessStartInf o psi = new ProcessStartInf o() ;
psi.FileName = "C:\\WINPOINT\\ import.exe";
psi.Arguments = "\"C:\\" + ListName + ".txt\"
\"P:\\PNTTEMPL\ \DATAIMP\\MMImp ort.imp\" \"P:\\2001\\bor rower\"";
psi.CreateNoWin dow = false ;
psi.UseShellExe cute = true;
psi.WorkingDire ctory = "C:\\WINPOI NT";
Process.Start( psi ) ;
psi = null;
Nov 15 '05 #1
0 1323

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...
1
7293
by: nospam | last post by:
Hi, Can you let me know why this won't display the standard output on console? Thanks Process myProcess = new Process();
2
10455
by: Eranga | last post by:
I have a windows application in C# which has the following method public void InitiateSession(string server,string userName, string passWd ) { //To start the command System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(); psi.FileName = @"C:\WINDOWS\system32\cmd.exe"; // Path for the cmd prompt psi.Arguments = @"c\ net use \\servername\IPC$ /USER:domain\user
0
1750
by: MadCrazyNewbie | last post by:
Hi Group, I have the following code, but not sure if this is write, I would like to be able with the View code, for the document to be opened eg. C:\test.Doc and with the PRint button for it to Autmatically Print. The code I have so far is: Private Sub btnViewDoc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewDoc.Click
2
4090
by: Samuel R. Neff | last post by:
I'm trying to find a good way to handle Control.InvokeRequired without duplicating four lines of code in every function/event. Typically what I've seen in books is this: If InvokeRequired Then Invoke(new EventHandler(AddressOf thisFunc), new Object() { sender, e}) Return End If
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"
1
9271
by: Vinny Vinn | last post by:
I am using the following C# code to print a PDF to a network printer. The document prints in portrait mode, I would like the document to print in Landscape mode. Is there/What is the argument that I need to supply to accomplish this? ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = FileName; startInfo.Verb = "printto"; startInfo.Arguments = @"\\server1\Printer1"; startInfo.CreateNoWindow = true;
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)
2
3155
by: =?Utf-8?B?TWljaGVsbGUgTWFiZWxsZQ==?= | last post by:
I have the code below. It will open and print the pdf file (test.pdf) to the printer. ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.UseShellExecute = true; startInfo.Verb = "Print"; startInfo.CreateNoWindow = true; startInfo.WindowStyle = ProcessWindowStyle.Minimized; startInfo.FileName = @"E:\\barcode\test.pdf"; Process p = new Process();
0
9721
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
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
10633
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...
1
10375
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
9198
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...
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
3860
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.