Redirect And Parse In Realtime Stdout Of An Long Running Process?

Apr 12, 2010

This code executes "handbrakecli" (a command line application) and places the output into a string:

Dim p As Process = New Process
p.StartInfo.FileName = "handbrakecli"
p.StartInfo.Arguments = "-i [source] -o [destination]"

[code].....

View 1 Replies


ADVERTISEMENT

Redirecting Stdout In Realtime?

Sep 29, 2010

I am writing an application in VB .NET which calls external executables (written in C++)and passes them some command line arguments. What I need to do is read back their stdout outputs inealtime , i.e. as they run.I am currently using the ProcessStartInfo class and setting the RedirectStandardOutput property to true and reading it back in from a StreamReader. However, I cannot read this back in realtime. Once the process finishes, the StreamReader will allow me to

View 12 Replies

Windows - Long Running Process?

Jun 2, 2011

I have a service ticket management application and users want to open several ticket details on a tab in a MDI frame. Since this application has to communicate through Web XML service with other company, it takes around 15 ~20 seconds. The users most complain is that he needs to wait until a saving process is done. Cursor is working while data is being saved and other can't be done

View 3 Replies

How To Handle Long Running Process - Hang When It Run Til Half Way

Jul 6, 2012

for example:

dim a as long

for i as integer = 1 to 10000000

[CODE]..........

It will hang when it run til half way.

View 1 Replies

Redirect Console Output To A Form's Textbox In Realtime?

May 26, 2007

send the text from a certain line in the hidden console window to a textbox in the form, but I need this output while the console application is still running in a hidden window. Since I am going to have multiple instances of this console application running, I have assigned their processes to an array and each have a separate "hidden" console window. After I launch these applications (with different arguments assign to them), they require no input and will run until I ".kill them" using the GUI.The console application was written in the old C and it's source code scares me.

I am creating this GUI "bolt on" application for it in VB.NET 2005 to clean up desktop space (save me from 30 console windows) and to be able to start, stop, and monitor them from a single clean GUI.Attempted solutions:I have reviewed the information [URL]But again, that just tells me how to capture the output of it after the console application has exited, which I already know how to do and I do not wish to kill the application just to see a certain line of it's output as it would obviously interrupt what it is doing.

View 5 Replies

Using WSF (Windows Scripting File) To Retrieve Component Services Running Process ID's Using Running Process Name

May 7, 2009

I am trying to write a Windows Script that will allow me to monitor the following: That 2 x seperate but specific processes within Component Services "Running Processes" list are currently running and have not reset within the past hour. If I already know the PID, then I can retrieve the CreationDate (I assume which I can use to check for restarts? or is this the actual process creation/installation date) for each specific process, however if a restart occurs the PID will change and my script needs to know what the new PID is without me telling it!

[Code]...

View 2 Replies

.net - Deal With Output From A Secondary Process In Realtime?

Apr 27, 2012

I am trying to write a VB .NET program that runs a Perl script and reads and uses the standard output. I'd like to be able to handle each line separately as it is printed, and update my program display accordingly. Here's some code I have "written" (read: "mostly copied off the internet"):

Private WithEvents pscript As Process
Private Sub myProgram_Load(sender As Object, e As System.EventArgs) Handles Me.Load
pscript = New Process()

[Code]....

This works with one problem: the program waits until the test script has run to completion, and then fires several OutputDataReceived events one after the other. This means that when I make it use the real script, it's likely to do nothing for as much as several hours, and then have to deal with, like, 5,000 events at once, despite the fact that stuff was being printed at fairly regular intervals throughout that time.

Is there any way I can make it deal with each line of text when it is written, instead of all of it at once at the end?

View 2 Replies

Running A DOS Command And Show Output In Textbox Realtime?

May 25, 2010

I want to run some dos commands (eg: a ROBOCOPY) and show the output from this realtime in a text window to show the user something is happening.The command may take a number of minutes so it's important the output is showing in the VB application realtime, and not just all at the end. Obviously the user will wonder what is happening during this time.

View 19 Replies

Redirect The Standard I/O Of A Process?

Apr 10, 2009

How do I redirect the standard I/O of a process?

View 2 Replies

Process.start And Redirect Output To File?

Jan 15, 2011

I want to launch a file from a VB program and capture the output of that file in a text document.Here's an example:Process.Start("systeminfo.exe > Data.dat")This doesn't work. I get an error that the file cannot be found. I've tried using Shell instead of Process.Start. I've also tried replacing systeminfo.exe with a variable and replacing the redirect portion with a variable.The ultimate goal is to get the text file e-mailed. So, if it were possible to output to the Clipboard, then paste that to a file or directly into an e-mail client that would also work.

View 1 Replies

Shell - Process Redirect Output Not Working

Mar 1, 2012

I'm trying to redirect the output from a command-line application in VB.NET, and for some reason it fails to redirect the output. Here's my code:

Dim myProcess As Process = New Process
myProcess.StartInfo.FileName = "g++"
myProcess.StartInfo.Arguments = CMDLineCommand

[Code]......

View 1 Replies

VS 2005 - Redirect Input Stream To Process

Oct 22, 2009

I don't know VB very well, but I need to create a wrapper program for any executable that logs the arguments, all input, output and err information:

My wrapper is called: e.g. someApp.exe arg1 arg2
Logs to someApp.log: arg1 arg2
Calls original executable: _someApp.exe arg1 arg2
Must log and forward any console input to _someApp process inputstream
Must log any output and error stream from _someApp process

I'm stuck at point 4 now:
Dim p As New ProcessStartInfo
p.FileName = execute
p.Arguments = Command()
p.UseShellExecute = False
p.CreateNoWindow =
[Code] .....

After _someApp ends I am able to read out and err stream to log it, but I still need to provide my own wrappers input to the process and I want to read out and err stream as it happens.

View 2 Replies

How To Redirect A Page After Running All VB Code And Then Rendering The HTML

Aug 31, 2009

I have an ASP.NET Form (aspx). It uses VB as the codebehind. I want ALL of the VB to run and then the page to render BEFORE redirecting to the specified form. The problem is, is that I have Response.Redirect calls in the middle of the VB code (aspx.vb) and it seems to redirect before rendering the page. Is there any way around this? I need to have the page render so that some JavaScript on the client side (aspx) can run (it is for Google Analytics).

View 2 Replies

Process.Start Fails When Attempting To Redirect The Output

Nov 17, 2009

I've been working on automating our build processes and wanted to come up with a painless way to run unit tests on a regular basis. To that end I've thrown together a simple app that examines the project files and prepares a list of solutions to test. The prototype works in that the tests are executed with the expected results, but as soon as I try to redirect my output the app bombs on the Process.Start call, complaining that a file could not be found.

I've tried several iterations on what I've seen done elsewhere, including several posts here, but I have yet to get this to work properly.

This works:

Private Function WTF(ByVal aWorkingDirectory As String, ByVal aFileName As String, ByVal aArguments As String) As Boolean
Dim lProcess As New Process()
With lProcess

[Code].....

View 1 Replies

Write A Little Program That Checks For A Process - ,,Cheat Engine" Is Running The Process Is Getting Killed?

Oct 13, 2009

i am trying to write a little program that checks for a process and kills is.here is the

Dim p As Process = Process.GetProcessesByName("Cheat Engine")(0)
p.CloseMainWindow()[code]...

My problem is it�s woking ,yes if the programm ,,Cheat Engine" is running the process is getting killed.But if the program is not running my program crashes.

View 5 Replies

VS 2008 If Process Is Running Give Focus, If Not Start Process?

May 27, 2010

Trying to create a button that when clicked will check to see if a certain process image is running and if that process is running give the process focus. If the process is not running then start the application.

View 9 Replies

C# :: Long Time Running Applications?

Jul 5, 2010

I'm going to design an Application (C# or VB.NET) which use .NET Framework to run for very long time. It may be restarted every year or even more...Is there anything (using special design patterns or so) which I must care about in designing "Long time running applications in .NET"?

View 3 Replies

Handling Long Running Webrequest?

Jun 29, 2009

I have a web request that can take 30-90 seconds to complete in some cases(most of the time it completed in 2-3). Currently, the software looks like it has hung if the request takes this long. I was thinking that I could use background worker to process the webrequest in a separate thread. However, The software must wait on the request to process before continuing. I know how to setup the background worker. What I am unsure about is how to handle waiting on the request to process.Do I need to create a timer to check for the results until the request times out or is processed?

View 1 Replies

Program Freezes During Long Process?

Aug 1, 2009

[code].....

View 15 Replies

C# - Use For A SOA Solution To Exec A Long Running Task?

Jan 30, 2012

I am developing a solution in .Net utilising the VMWare Web Service API to create new isolated virtualised development environments. The front end will be web based. Requestors input details for the specific environment which will be persisted to SQL. So I need to write an engine of some sort to pull the data from SQL and work on the long running task of creating resource pools, switch port groups and cloning existing VM templates etc. As work progresses, events will be raised to write logs and update info back to SQL. This allows requestors to pull data back into a webpage to see how it's progressing or if it's completed.

The thing I am struggling with is how to engineer the engine which will exec the long running task of creating the environment. I cannot write a windows service (which I would like) as we work in a very secure environment and it's not possible (group policy etc). I could write a web service to execute the tasks, extending the httpRuntime executionTimeout to allow the task to complete. But I'm keen to hear what you guys think may be a better solution to use (based on .Net 3.5). The solution needs to be service oriented as we may be using it on other projects within our org. What about WWF, WCF? I have not used any of the newer technologies available since .Net 2.0 as we've only just been approved to move up from .Net 2.0.

View 2 Replies

Long Running Operation, Nonresonsive Program?

Jun 30, 2010

I have written a program that searches a bunch of urls and pulls out information that I need. The program works to an extent. Everything codewise works, but it seems like I did a sloppy job of pulling the code together. After about 10 minutes of running, the program just becomes unresponsive and I have to close it through task manager. I've seen it range from 100k to 350k in memory useage. It also uses about 80%+ cpu usage at all times. I hope someone might be able to see something that I forgot or did wrong as the program is meant to run almost full time, executing parts of code on certain days/times.

Dim con As New SqlClient.SqlConnection
Dim strCon As String = "Data Source=server;Initial Catalog=database;Integrated Security=True"
con.ConnectionString = strCon

[code]....

View 1 Replies

How To Change A Button's Image During A Long Process

May 29, 2009

I've got a common search button in my app that has the typical static magnifying image displayed on it. When the user clicks it I want the button's image to change to the animated search, to inform the user that the app is doing something (searching the database). Then when the search process is complete, change back to the static search image.

[code]...

When I comment out the line to change the button's image back to the static search image, (as stated above), and click the search button, the app actually performs the search, then when the search is completed, it changes the button's image.

Apparently VB or .Net is performing the under-the-hood process before the display/paint process, even though that's not the way it's coded. give me some insights on how to fix this, AND also please inform me of why this behavior occurs so I can try to avoid it in the future.

View 11 Replies

Update Labels Duing A Long Process?

Aug 23, 2009

I want to update & display the values of labels on my form during a long loop.[code]...

View 6 Replies

Process Efficiency And Possible Way To Parse

Aug 9, 2010

So i am working on a program that needs to run NSLookup for a Computer name specified by the user. Here is the code I have developed which works:[code]Now because of the dynamic domains that this will be on, it is difficult to nail down which character to start a read at to determine if the Computer name exists. For some reason the reader is not picking up the '***Non-existent' line that is reported from NSLookup. When i run the NSLookup it requires me to run the Function 2x before it displays a result in my lblresults. With that pre-knowledge,

1. How do i make the NSLookup Process more efficient?

2. Is there a better way to Parse the information to specificly pull the lines that have been reported back, specificly the '***Non-existent' line.

View 1 Replies

Visual Studio 2010 - Parse A Long Text Separated By "*"

Apr 14, 2011

I am trying to parse a long text separated by *. That text has to be shown like the second example. What is the simplest way of parsing this sample text in order to sort the text for easy reading.

[Code]...

View 3 Replies

Program Becoming Unresponsive Whilst Running Long Code

Jan 31, 2011

I'm currently trying to write a football simulator but am having issues with the computer becoming unresponsive. There are long lines of code (several thousand lines) that are executed over and over as one run of the code is equivalent to one second of game time. While the game is setup to be like Football Manager where you watch the game live, there will also be cases where the entire game is simulated without you watching. When doing a full sim of a game, I just have a loop which executes the code block 7200 times (games go for two hour roughly).

At the moment this takes about a minute but even when I get it down to the desired 5-10 seconds or so, I dislike the fact that the computer becomes completely unresponsive during this time. In a round there are 9 games and you'll be simulating without watching 8 of them. You're looking at 1-2 minutes of simulation time or possibly more. I can't have a loading screen that long! How can I program the game so it runs these simulations yet the game still remains responsive? It'd be fine if the user could muck around in the menus and stuff while the simulation runs.

View 10 Replies

Force A Progress Bar To Update During A Long-running Operation In Program?

Dec 19, 2010

I am running a test program for VB.NET, and it will simply crunch a million numbers in for loop. I've linked a variable implying the progress of the for loop with the progress bar, but it seems that when I run the program, the progress bar does not update itself. The bar itself has only value 0-100 as input (as stated in the document) and I've tested it without using the for loop, and it works.

View 2 Replies

VS 2008 - Using Function In Order To Get Item Code From Database Long.Parse(myReader(0)).ToString("2200000000000")

Oct 26, 2009

I would like to ask some questions related some functions i want to make in my program:

1. I am using this function in order to get a the item code from the database Long.Parse(myReader(0)).ToString("2200000000000") the result i get is: 2200000059091. The form that i want the resultset is
22 (fix value) + item code (6 characters right justified) + 00000 (fix value) 2205909100000 how should i change my code to obtain this result?

2. The programs every time it runs creates a text file which i also attached it plu1.txt, when i try to open it with notepad i see all the lines justified, on the other hand when i open the text file with Wordpad or ConTEXT the lines are not fixed, others are longer others are shorter? What should i change in my code in order to have every line fixed lenght... The code i am using is the following

Dim myReader As SqlDataReader = myCMD.ExecuteReader()

Dim fNextResult As Boolean = True

Using myWriter As IO.StreamWriter = New IO.StreamWriter("c:everest

[CODE]...

3. third and last question is that my program every time it ends show up a pop up menu which says "Text is created." Instead of this i would like to create a file lets say log.txt and every time the program runs, it will overwrite on the log.txt file a line like this: system date + Text is created + with X lines (where X are the lines of the text plu1.txt) ex. 26-10-2009 14:56 Text file created with 15 lines

View 4 Replies

[2008] Display The Process Name When Parse A File?

Mar 16, 2009

I am parsing many files after I click the button.I want to display the process name when I parse a file. So I am going to display it as

Label3.Text = "Parsing File " + FileName

The problem is the screen is freeze if too many files will be parsed. So designing an event to display the file name that is processed is a good idea. But I haven't any experence on it.

Private Sub ExtractButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExtractButton.Click
Dim saveFilein As String
Dim FileName As String

[code]....

View 6 Replies

Force A .NET Dll Running In A 32 Bit Process To 'act' Like A 64 Bit Process?

Mar 2, 2011

I am almost sure this isn't possible but it's worth an ask... We have a .NET DLL that is being called from our VB6 application. The VB6 app runs in a 32 bit process so the DLL runs in the same process (it's compiled as any cpu) Therefore when I do my ODBC Database access in the DLL is will only use a 32 bit driver, as this is what it thinks it needs (for the record the DB is Pervasive PSQL)

My problem arises when the application runs on a 64 bit machine (when only the 64 bit ODBC driver is installed) as it can't find a suitable driver to use. So is there a way to force the .NET DLL to run in a 64 bit process (compiling as x64 doesn't work because register for COM Interop is not allowed) This isn't necessarily an issue at this point in time because I can install the 32 bit driver, but at some point in the future I can imagine that 32 bit driver may not be available so I will be up the proverbial creek.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved