473,324 Members | 2,124 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,324 software developers and data experts.

Process, ProcessStartInfo fail to run large batch file

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 fails when identically invoked by the same app

REM This is a test This is a test This is a test This is a test This is a test
REM This is a test This is a test This is a test This is a test This is a test
[40 more of these remark lines
echo %PATH% > c:\com\molex\plot\wmIntegration\logs\p0.lo

I am able to reproduce this error 100% of the time on two separate machines, both of which run Windows 2000 server

I doubt that this problem is related either to environment space or total RAM available to the program, because nothing in the above batch file should use up any environment space, or more than a trivial amount of memory. Also, on one of the machines, I tried setting the following in the file c:\WINNT\System32\CONFIG.NT

shell=%SystemRoot%\system32\command.com e:1638

Adding the above line did not affect the problem

Here is the chunk of code which seems most relevant

Protected Overridable Function ExportFileWorkManager() As Boolea
Dim sCmdShell As Strin
Dim oProcess As Proces
Dim oStartInfo As ProcessStartInf
Dim oProcessMonitor As ProcessMonito

'java program hangs(?) or takes long time when these do not have setting
If moJobQueue.DOC_CLASS_NAME = Nothing Or moJobQueue.PROGRAM_NAME = Nothing The
Return Fals
End I

Tr
oStartInfo = New ProcessStartInfo(moConfig.WorkManagerExePath
oStartInfo.Arguments = "export_native @1 @2".Replace("@1", moJobQueue.DOC_ELID).Replace("@2", moJobQueue.PROGRAM_NAME
goLog.LogEntry("IPlot", "ExportFileWorkManager", oStartInfo.Arguments
oStartInfo.CreateNoWindow = Fals
'oStartInfo.RedirectStandardOutput = Tru
oStartInfo.UseShellExecute = Fals
oStartInfo.WindowStyle = ProcessWindowStyle.Norma

'sCmdShell = Quote(moConfig.WorkManagerExePath) & " export_native @1 @2
'sCmdShell = Replace(sCmdShell, "@1", moJobQueue.DOC_ELID
'sCmdShell = Replace(sCmdShell, "@2", moJobQueue.PROGRAM_NAME

oProcess = New Process(
oProcess.StartInfo = oStartInf

'Shell(sCmdShell, AppWinStyle.Hide, True
oProcess.Start(
oProcessMonitor = New ProcessMonitor("java"
oProcessMonitor.Start(
oProcess.WaitForExit(
'System.Diagnostics.Debug.WriteLine(oProcess.Stand ardOutput.ReadToEnd
'Dim sValue As String = oProcess.StandardOutput.ReadToEn
oProcess.Dispose(
oProcessMonitor = Nothin
Catc
Return Fals
End Tr

'check to make sure our export is there ..
If FileExists(msExportFileName) = False The
Return Fals
End I

Return Tru
End Function 'export the workmanager fil

It looks very much like somehow, internally to .NET, the .cmd file is getting stored in a buffer with maximum size around 1000 bytes. When the file is bigger, it gets truncated

I'm hoping someone from Microsoft can look in to this problem

Thank
Nov 15 '05 #1
0 2222

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

Similar topics

1
by: Fred Mellender | last post by:
I looked at http://www.codeproject.com/csharp/LaunchProcess.asp?target=process and tried to follow the code there. My code is: public class Test { public ProcessStartInfo StartInfo; public...
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...
3
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...
15
by: jcrouse | last post by:
Here is my code: Dim sw As StreamWriter = File.CreateText(Application.StartupPath & "\mameversion.bat") sw.WriteLine(lblMameExePath.Text & " -help >""" & Application.StartupPath &...
6
by: jcrouse | last post by:
This is kind of a continuation of another thread that was somewhat resolved: Well, the dilemma seems to be this. I want to be able to hide the DOS box AND pause the code until execution is...
3
by: Zeya | last post by:
I have created a very simple batch file and trying to retrieve the standard output but everytime I run the code it returns ExitCode as 1. I have created a batch file as simple as ping localhost...
2
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...
9
by: Eran.Yasso | last post by:
Hi, My app starts process. Some times this process exits because of exception. Can my app know if the process exited due to exception or gracefully? In both ways, the exit code of this...
0
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I started a thread regarding this issue, but now i'm facing new problem, so i'm starting a new thread, hope it's ok... anyway, using my c# windows application, i'm excuting and exe file...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.