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

C# exe calling an exe (process.start) - not working on one server

Hello,
I have a C# program that builds a txt file and then, calls an external
exe (this external exe simply imports this txt file into a DBF (DBase) file.
(we copy a template of the DBF file into the process folder where the exe
lies and then this clipper EXE does the data move from the txt file to the
DBF file).
This process works fine on at least 3 PCs (Win 2K Pro and Win XP Pro) -
irrespective of whether I schedule the process or run it by double clicking
the executable. However, when I try to run this same process on a Win2000
server, this data move doesn't happen (the DBF file doesn't get populated).
Since it is a production server, I cannot debug the code there and I am
unable to recreate the problem on any of the test machines. The program
doesn't crash or throw an exception - just doesn't do the data move and
continues as though nothing is wrong. If I call this second exe (for the data
move) manually, it works fine and moves the data.

I have this C# program set up on the windows scheduler and it is running
with privileges of an ID that has Local Adminitrator rights.

Any suggestions as to how to resolve this?
Thanks
- Joseph

Jul 21 '05 #1
5 6053
Joseph <Jo****@discussions.microsoft.com> writes:
Hello,
I have a C# program that builds a txt file and then, calls an external
exe (this external exe simply imports this txt file into a DBF (DBase) file.
(we copy a template of the DBF file into the process folder where the exe
lies and then this clipper EXE does the data move from the txt file to the
DBF file).
This process works fine on at least 3 PCs (Win 2K Pro and Win XP Pro) -
irrespective of whether I schedule the process or run it by double clicking
the executable. However, when I try to run this same process on a Win2000
server, this data move doesn't happen (the DBF file doesn't get populated).
Since it is a production server, I cannot debug the code there and I am
unable to recreate the problem on any of the test machines. The program
doesn't crash or throw an exception - just doesn't do the data move and
continues as though nothing is wrong. If I call this second exe (for the data
move) manually, it works fine and moves the data.

I have this C# program set up on the windows scheduler and it is running
with privileges of an ID that has Local Adminitrator rights.

Any suggestions as to how to resolve this?
Thanks
- Joseph


Add logging.

I am really guessing. It might be a security issue. I know, I know...

By the way, Win 2K cmd.exe has some command line size limitations.
Jul 21 '05 #2
Thank you for your quick response! I am not familier with how to add
logging... is that on the server or is that something that needs to be done
while I build the C# code?
Thanks again!
"bazad" wrote:
Joseph <Jo****@discussions.microsoft.com> writes:
Hello,
I have a C# program that builds a txt file and then, calls an external
exe (this external exe simply imports this txt file into a DBF (DBase) file.
(we copy a template of the DBF file into the process folder where the exe
lies and then this clipper EXE does the data move from the txt file to the
DBF file).
This process works fine on at least 3 PCs (Win 2K Pro and Win XP Pro) -
irrespective of whether I schedule the process or run it by double clicking
the executable. However, when I try to run this same process on a Win2000
server, this data move doesn't happen (the DBF file doesn't get populated).
Since it is a production server, I cannot debug the code there and I am
unable to recreate the problem on any of the test machines. The program
doesn't crash or throw an exception - just doesn't do the data move and
continues as though nothing is wrong. If I call this second exe (for the data
move) manually, it works fine and moves the data.

I have this C# program set up on the windows scheduler and it is running
with privileges of an ID that has Local Adminitrator rights.

Any suggestions as to how to resolve this?
Thanks
- Joseph


Add logging.

I am really guessing. It might be a security issue. I know, I know...

By the way, Win 2K cmd.exe has some command line size limitations.

Jul 21 '05 #3
Add logging (i.e. Write debug text to a file) to see what is happening when
the thing kicks off. It may not be execing at all - maybe the cmd line is
not found. Check the exit code from the process (if you set exit codes in
the second exe.) Also, I ran into a similar issue where I knew the app
started but just stalled. The problem what Std out redirection related. If
the std out or std err streams get full, it can block the progress of the
app and just freeze. You can test this by setting a timeout on the process
to kill it after X seconds. You should have some timeout anyway to prevent
and/or be notified of such things. The solution to my problem would have
been to create another thread to read the std out so it would not block
(still on my list.) hth

--
William Stacey, MVP
http://mvp.support.microsoft.com

"Joseph" <Jo****@discussions.microsoft.com> wrote in message
news:EA**********************************@microsof t.com...
Thank you for your quick response! I am not familier with how to add
logging... is that on the server or is that something that needs to be done while I build the C# code?
Thanks again!
"bazad" wrote:
Joseph <Jo****@discussions.microsoft.com> writes:
Hello,
I have a C# program that builds a txt file and then, calls an external exe (this external exe simply imports this txt file into a DBF (DBase) file. (we copy a template of the DBF file into the process folder where the exe lies and then this clipper EXE does the data move from the txt file to the DBF file).
This process works fine on at least 3 PCs (Win 2K Pro and Win XP Pro) - irrespective of whether I schedule the process or run it by double clicking the executable. However, when I try to run this same process on a Win2000 server, this data move doesn't happen (the DBF file doesn't get populated). Since it is a production server, I cannot debug the code there and I am unable to recreate the problem on any of the test machines. The program doesn't crash or throw an exception - just doesn't do the data move and continues as though nothing is wrong. If I call this second exe (for the data move) manually, it works fine and moves the data.

I have this C# program set up on the windows scheduler and it is running with privileges of an ID that has Local Adminitrator rights.

Any suggestions as to how to resolve this?
Thanks
- Joseph


Add logging.

I am really guessing. It might be a security issue. I know, I know...

By the way, Win 2K cmd.exe has some command line size limitations.


Jul 21 '05 #4
On Mon, 8 Nov 2004 15:23:02 -0800, Joseph wrote:
Since it is a production server, I cannot debug the code there and I am
unable to recreate the problem on any of the test machines. The program


The VS.Net debugger can attach to processes on other machines. You can
debug across the network, assuming you have access to the machine and the
necessary permissions.

Click Tools->Debug Processes

You can specify the machine name in the Name: dropdown and then a list of
the processes will appear. Select the right one and click attach. Your
debugger will now stop at breakpoints!

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Jul 21 '05 #5
Thank you all for your quick help and suggestions! Unfortunately, I don't
have the source code for the exe that is being called by the C# program, so
am unable to debug it (to set some exit codes - this exe is an old pgm and
doesn't return any return codes).

However, a co-worker pointed out the problem in this case - turns out that
because I was using the windows scheduler to schedule this C# program after
RDP'ing into the server, and was logging off (rather than disconnecting), the
process didn't work. Apparently, the called exe needs the user to be logged
on. Anyway, if I disconnect from my RDP session (instead of logging off), the
process works fine and the data gets pulled into the DBF file!

Thanks for your suggestions though - I'm sure I will get to use them for
other problems that I face in the future!

"Joseph" wrote:
Hello,
I have a C# program that builds a txt file and then, calls an external
exe (this external exe simply imports this txt file into a DBF (DBase) file.
(we copy a template of the DBF file into the process folder where the exe
lies and then this clipper EXE does the data move from the txt file to the
DBF file).
This process works fine on at least 3 PCs (Win 2K Pro and Win XP Pro) -
irrespective of whether I schedule the process or run it by double clicking
the executable. However, when I try to run this same process on a Win2000
server, this data move doesn't happen (the DBF file doesn't get populated).
Since it is a production server, I cannot debug the code there and I am
unable to recreate the problem on any of the test machines. The program
doesn't crash or throw an exception - just doesn't do the data move and
continues as though nothing is wrong. If I call this second exe (for the data
move) manually, it works fine and moves the data.

I have this C# program set up on the windows scheduler and it is running
with privileges of an ID that has Local Adminitrator rights.

Any suggestions as to how to resolve this?
Thanks
- Joseph

Jul 21 '05 #6

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

Similar topics

4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
1
by: Bucky Pollard | last post by:
I have a web service that needs to create a batch file and call it (since there are no APIs for the functionality I am looking for). I am using the Process and ProcessStartInfo objects. When I try...
8
by: Rob Kellow | last post by:
Hello, I'm working on an application for use within my company on our intranet that will be used to gather some information and store some of the info in a SQL Server database and the rest of the...
6
by: Marlene Arauz Martin | last post by:
Hello, How's everybody??? I have an aspx. page that is calling an executable,....like this... System.Diagnostics.ProcessStartInfo psi= new System.Diagnostics.ProcessStartInfo();...
2
by: Roja Doja | last post by:
I need to be able to change the Terminal Services attributes. Using vbscript on Server 2003 this is easy enough, as described at ...
5
by: Joseph | last post by:
Hello, I have a C# program that builds a txt file and then, calls an external exe (this external exe simply imports this txt file into a DBF (DBase) file. (we copy a template of the DBF file into...
11
by: Nurit N | last post by:
This is the third newsgroup that I'm posting my problem. I'm sorry for the multiple posts but the matter becoming urgent. I hope this is the right place for it... I have created a very...
0
by: pratikkagda | last post by:
Hi, I have created desktop applications in visual basic .net (Framework 2.0) which access the web information from a particular site. This application is working great. There is no problem at all....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
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,...
0
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...
0
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,...

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.