473,379 Members | 1,544 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,379 software developers and data experts.

ProcessStartInfo duplicating code execution

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 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(PointData);
sr.Close();
ProcessStartInfo psi = new ProcessStartInfo() ;
psi.FileName = "C:\\WINPOINT\\import.exe";
psi.Arguments = "\"C:\\" + ListName + ".txt\"
\"P:\\PNTTEMPL\\DATAIMP\\MMImport.imp\" \"P:\\2001\\borrower\"";
psi.CreateNoWindow = false ;
psi.UseShellExecute = true;
psi.WorkingDirectory = "C:\\WINPOINT";
Process.Start( psi ) ;
psi = null;
Nov 15 '05 #1
0 1297

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

Similar topics

0
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...
1
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
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...
0
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...
2
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...
1
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...
1
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...
1
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...
2
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 =...
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.