By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,934 Members | 1,804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,934 IT Pros & Developers. It's quick & easy.

Shell Commands

P: n/a
Hi,

My application uses SHELL command to run external programs, like this :

Shell("program.exe", AppWinStyle.MinimizedNoFocus, True)

or

Shell("program.exe", AppWinStyle.Hide, True)

It runs OK, but my application don't refresh, I can't see the logs of my
application's listbox, nothing, it like it freezes/hangs alghought that
isn't true because all batch jobs runs 1 by 1 until the end

Just want to refresh my application, I tried doEvents but without success

thank you
Jan 10 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
You have set the boolean to wait.
does program.exe also quit?

"martins" <xx*@hotmail.com> schreef in bericht
news:OR*************@TK2MSFTNGP09.phx.gbl...
Hi,

My application uses SHELL command to run external programs, like this :

Shell("program.exe", AppWinStyle.MinimizedNoFocus, True)

or

Shell("program.exe", AppWinStyle.Hide, True)

It runs OK, but my application don't refresh, I can't see the logs of my
application's listbox, nothing, it like it freezes/hangs alghought that
isn't true because all batch jobs runs 1 by 1 until the end

Just want to refresh my application, I tried doEvents but without success

thank you

Jan 10 '06 #2

P: n/a
"newbie" <as***@aswin.be> wrote in message
news:43***********************@news.skynet.be...
You have set the boolean to wait.
does program.exe also quit?


Yes it quits, I need that boolean ON because I have several jobs to run in
batch mode and I need to wait until each job ends

The only problem is that I can't activate my program - it says "not
responding"

but this is not true

Is it impossible to refresh my application or give it some focus ?

application.doenvents doesn't work, Shell's option of
AppWinStyle.MinimizedNoFocus or Hide, doesn't work

This jobs needs very processor and memory recurses
Jan 10 '06 #3

P: n/a
Shell is the old way of launching programs. You will find that you have
much better control useing the System.Diagnostics namespace.

Dim SI As New System.Diagnostics.ProcessStartInfo
SI.FileName = "program.exe"
SI.WindowStyle = ProcessWindowStyle.Hidden
Dim p As System.Diagnostics.Process =
System.Diagnostics.Process.Start(SI)
p.WaitForExit()
Me.Refresh()

Jan 11 '06 #4

P: n/a
what if your program is to busy to laubching all the programs?
Try to add a slow process like ( slow process = doesn't quit directly )
shell("ping www.google.be", .... )
your CPU = 99% ?

"martins" <xx*@hotmail.com> schreef in bericht
news:OR*************@TK2MSFTNGP09.phx.gbl...
Hi,

My application uses SHELL command to run external programs, like this :

Shell("program.exe", AppWinStyle.MinimizedNoFocus, True)

or

Shell("program.exe", AppWinStyle.Hide, True)

It runs OK, but my application don't refresh, I can't see the logs of my
application's listbox, nothing, it like it freezes/hangs alghought that
isn't true because all batch jobs runs 1 by 1 until the end

Just want to refresh my application, I tried doEvents but without success

thank you

Jan 11 '06 #5

P: n/a
I tried that process launch solution instead of shell command

Like this :

Dim SI As New System.Diagnostics.ProcessStartInfo
SI.FileName = startupfolder & "DVDAuthor\dvdauthor -o test -x " &
WorkingPath & "dvdauthor.xml"
SI.WindowStyle = ProcessWindowStyle.Hidden
Dim p As System.Diagnostics.Process =
System.Diagnostics.Process.Start(SI)
p.WaitForExit()
Me.Refresh()

And I always get an error on filename

But if I use shell command :

Shell(startupfolder & "DVDAuthor\dvdauthor -o test -x " & WorkingPath &
"dvdauthor.xml", AppWinStyle.Hide, True)

note: startupfolder is Application.ExecutablePath under I have all external
programs

It works, but my program freezes doesn't show the logs of all batch
processes, although IT WORKS WELL

The title of my application says always (NOT RESPONDING)

I'm stuck with this
Jan 11 '06 #6

P: n/a
My program is just an GUI for DVDAuthoring, I'm doing this for my personal
use

And you know that encoding video/audio takes a lot of memory and cpu usage

I'm using DVDAuthoring tools from sourceforge, they are free, and an decoder
software that is...hummm...you know...

but as I said, this is for my personal use and is a case study

this batch threads are making me nuts because my app runs well but without
responding
"martins" <xx*@hotmail.com> wrote in message
news:ec*************@TK2MSFTNGP15.phx.gbl...
I tried that process launch solution instead of shell command

Like this :

Dim SI As New System.Diagnostics.ProcessStartInfo
SI.FileName = startupfolder & "DVDAuthor\dvdauthor -o test -x " &
WorkingPath & "dvdauthor.xml"
SI.WindowStyle = ProcessWindowStyle.Hidden
Dim p As System.Diagnostics.Process =
System.Diagnostics.Process.Start(SI)
p.WaitForExit()
Me.Refresh()

And I always get an error on filename

But if I use shell command :

Shell(startupfolder & "DVDAuthor\dvdauthor -o test -x " & WorkingPath &
"dvdauthor.xml", AppWinStyle.Hide, True)

note: startupfolder is Application.ExecutablePath under I have all
external programs

It works, but my program freezes doesn't show the logs of all batch
processes, although IT WORKS WELL

The title of my application says always (NOT RESPONDING)

I'm stuck with this

Jan 11 '06 #7

P: n/a
uff :)

problem of hard batch jobs solved

I just must use/launch a system thread

simple, the program responds now and shows the logs
"martins" <xx*@hotmail.com> wrote in message
news:OR*************@TK2MSFTNGP09.phx.gbl...
Hi,

My application uses SHELL command to run external programs, like this :

Shell("program.exe", AppWinStyle.MinimizedNoFocus, True)

or

Shell("program.exe", AppWinStyle.Hide, True)

It runs OK, but my application don't refresh, I can't see the logs of my
application's listbox, nothing, it like it freezes/hangs alghought that
isn't true because all batch jobs runs 1 by 1 until the end

Just want to refresh my application, I tried doEvents but without success

thank you

Jan 12 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.