Advertisements

On 8 Sep 2006 00:31:13 +1200, mark <> wrote:
>
>
>I'm wanting to open a Windows application that resides on another machine
>across the network, and if that machine is not turned on I don't want the
>machine to "hang" while it figures that out.
>
>Using "\\<machine name>\<path>\<executable name>" inside a batch file
>mostly does what I need, but leaves an ugle DOS window open too.
>
>It's been ages since I've needed to use DOS batch files - is there a better
>way?
>
>Cheers,
>Mark

Advertisements

mark wrote:
> I'm wanting to open a Windows application that resides on another machine
> across the network, and if that machine is not turned on I don't want the
> machine to "hang" while it figures that out.

How about...

ping -n 1 -w 100 %MACHINEIP%
if errorlevel 1 goto eof
REM Whatever you need to do if the machine is running
:eof

In message <Xns9838C62B41433daveytaynospamplshot@203.97.37.6>, Dave Taylor
wrote:
> The Other Guy <> wrote in news:edpo96$shu$:
>
>> How about...
>>
>> ping -n 1 -w 100 %MACHINEIP%
>> if errorlevel 1 goto eof
>> REM Whatever you need to do if the machine is running
>>:eof
>>
>
> And an exit to close the window.

The Other Guy <> wrote in
news:edpo96$shu$:
> mark wrote:
>> I'm wanting to open a Windows application that resides on another
>> machine across the network, and if that machine is not turned on I
>> don't want the machine to "hang" while it figures that out.
>
> How about...
>
> ping -n 1 -w 100 %MACHINEIP%
> if errorlevel 1 goto eof
> REM Whatever you need to do if the machine is running
>:eof
>
> The Other Guy

Cool, but not quite what I need

From my original post:

"Using "\\<machine name>\<path>\<executable name>" inside a batch file
mostly does what I need, but leaves an ugle DOS window open too."

The key bit I'm looking for it a way to close the ugly DOS window as soon
as it launches the Windows app

Dave Taylor <> wrote in
news:Xns9838C62B41433daveytaynospamplshot@203.97.37.6:
> The Other Guy <> wrote in news:edpo96$shu$:
>
>> How about...
>>
>> ping -n 1 -w 100 %MACHINEIP%
>> if errorlevel 1 goto eof
>> REM Whatever you need to do if the machine is running
>>:eof
>>
>
> And an exit to close the window.

Unfortunately an exit after the command doesn't close the Window (I know,
it should, but I've already tried that ).

If runs in the background, the key point from my original post that people
have overlooked is that my batch file does what I want apart from CLOSING
ITSELF once it has launched the WIndows app, and that is the thing I have
forgotten how to do. Exit does not do the trick.

In message <Xns9838DF8CB52DFsometimes2003@60.234.1.32>, mark wrote:
> Lawrence D'Oliveiro <_zealand> wrote in
> news:edr892$jfk$:
>
>> Subject: Re: Batch file question
>> From: Lawrence D'Oliveiro <_zealand>
>> Newsgroups: nz.comp
>>
>> In message <Xns9838C62B41433daveytaynospamplshot@203.97.37.6>, Dave
>> Taylor wrote:
>>
>>> The Other Guy <> wrote in
>>> news:edpo96$shu$:
>>>
>>>> How about...
>>>>
>>>> ping -n 1 -w 100 %MACHINEIP%
>>>> if errorlevel 1 goto eof
>>>> REM Whatever you need to do if the machine is running
>>>>:eof
>>>>
>>>
>>> And an exit to close the window.
>>
>> Can't you just run the script in the background?
>>
>
> If runs in the background, the key point from my original post that people
> have overlooked is that my batch file does what I want apart from CLOSING
> ITSELF once it has launched the WIndows app

Why do you have to open a window in the first place? That's what I meant
by "running in the background"--no UI, no window.

Lawrence D'Oliveiro <_zealand> wrote in
news:edries$6f2$:
> Why do you have to open a window in the first place? That's what I
> meant by "running in the background"--no UI, no window.

I can use a shortcut to the batch file and set it to run minimized if that
is what you are thinking of - that would still leave an extra item sitting
on the taskbar that I'd not want there though, with the same name as the
actual program in this case, which would add to the confusion

I'm hoping someone in the news group remembers how to run a Windows app
from within a batch file, and then have the batch file quit - without
having to have it wait for the Windows app to quit before terminating.

mark wrote:
> "Using "\\<machine name>\<path>\<executable name>" inside a batch file
> mostly does what I need, but leaves an ugle DOS window open too."
>
>
> The key bit I'm looking for it a way to close the ugly DOS window as soon
> as it launches the Windows app

If you run another uninteresting batch file, will it close by itself?

This behaviour varies, depending on your Windows version. I think in NT
this is controlled by a registry setting.

If a generic batch file closes where your own doesn't, try passing the
close command through to a new instance of cmd.exe, or using the /C option.

In article <Xns9838F1B822E78sometimes2003@60.234.1.32>,
mark <> wrote:
>
>I'm hoping someone in the news group remembers how to run a Windows app
>from within a batch file, and then have the batch file quit - without
>having to have it wait for the Windows app to quit before terminating.

START WINDOWS_APP.EXE

There are various options to modify the behaviour of the command.

--
Don Hills (dmhills at attglobaldotnet) Wellington, New Zealand
"New interface closely resembles Presentation Manager,
preparing you for the wonders of OS/2!"
-- Advertisement on the box for Microsoft Windows 2.11 for 286

On 2006-09-08, mark <> wrote:
>
> If runs in the background, the key point from my original post that people
> have overlooked is that my batch file does what I want apart from CLOSING
> ITSELF once it has launched the WIndows app, and that is the thing I have
> forgotten how to do. Exit does not do the trick.

START //wherever/dir/application
exit

you may need to create a shortcut with close-on-exit checked and use that to
run the batch too.

In message <Xns9838F1B822E78sometimes2003@60.234.1.32>, mark wrote:
> Lawrence D'Oliveiro <_zealand> wrote in
> news:edries$6f2$:
>
>> Why do you have to open a window in the first place? That's what I
>> meant by "running in the background"--no UI, no window.
>
> I can use a shortcut to the batch file and set it to run minimized if that
> is what you are thinking of - that would still leave an extra item sitting
> on the taskbar that I'd not want there though, with the same name as the
> actual program in this case, which would add to the confusion

I thought Windows was a multitasking OS. Is there no way to start a process
completely detached from any GUI? For instance in Linux, from an
interactive shell I can type

setsid command-i-want-to-run </dev/null >/dev/null 2>&1

where the /dev/null redirections ensure that the command has no connection
to the current terminal window at all, and the setsid causes the background
process to have its own session group, so it's not terminated when I log
out of the interactive shell.

For non-interactive invocation, there are even more ways, like the "at"
command, and crontab. E.g. I wake myself up in the morning like this:

(Don Hills) wrote in
news::
> In article <Xns9838F1B822E78sometimes2003@60.234.1.32>,
> mark <> wrote:
>>
>>I'm hoping someone in the news group remembers how to run a Windows app
>>from within a batch file, and then have the batch file quit - without
>>having to have it wait for the Windows app to quit before terminating.
>
> START WINDOWS_APP.EXE
>
> There are various options to modify the behaviour of the command.

Already tried start - with the executable path being a UNC it just stops
with shell window open.. It doesn't actually launch the executable.

jasen <> wrote in news:edslv5$c2g$:
> On 2006-09-08, mark <> wrote:
>>
>> If runs in the background, the key point from my original post that
>> people have overlooked is that my batch file does what I want apart
>> from CLOSING ITSELF once it has launched the WIndows app, and that is
>> the thing I have forgotten how to do. Exit does not do the trick.
>
> START //wherever/dir/application
> exit

I've already tried exactly the above, unfortunately when passed a UNC path
to the executable it just stops - no error messages and no application
launch.

> you may need to create a shortcut with close-on-exit checked and use
> that to run the batch too.
>
> Bye.
> Jasen

There is no close-on-exit option for a shortcut pointing at a batch file
under Windows XP Pro, but in this case, even it there was it wouldn't work
because it never actually reaches the end of the batch file until the
application launched by the batch file is exited.

On Sat, 09 Sep 2006 09:32:50 +1200, Lawrence D'Oliveiro
<_zealand> wrote:
>In message <Xns9838F1B822E78sometimes2003@60.234.1.32>, mark wrote:
>
>> Lawrence D'Oliveiro <_zealand> wrote in
>> news:edries$6f2$:
>>
>>> Why do you have to open a window in the first place? That's what I
>>> meant by "running in the background"--no UI, no window.
>>
>> I can use a shortcut to the batch file and set it to run minimized if that
>> is what you are thinking of - that would still leave an extra item sitting
>> on the taskbar that I'd not want there though, with the same name as the
>> actual program in this case, which would add to the confusion
>
>I thought Windows was a multitasking OS. Is there no way to start a process
>completely detached from any GUI?

I'm no expert but I think what you are describing can be done with a
service.

On 8 Sep 2006 00:31:13 +1200, mark <> wrote:
>I'm wanting to open a Windows application that resides on another machine
>across the network, and if that machine is not turned on I don't want the
>machine to "hang" while it figures that out.
>
>Using "\\<machine name>\<path>\<executable name>" inside a batch file
>mostly does what I need, but leaves an ugle DOS window open too.
>
>It's been ages since I've needed to use DOS batch files - is there a better
>way?

In message <>, El Penguino wrote:
> On Sat, 09 Sep 2006 09:32:50 +1200, Lawrence D'Oliveiro
> <_zealand> wrote:
>
>>In message <Xns9838F1B822E78sometimes2003@60.234.1.32>, mark wrote:
>>
>>> Lawrence D'Oliveiro <_zealand> wrote in
>>> news:edries$6f2$:
>>>
>>>> Why do you have to open a window in the first place? That's what I
>>>> meant by "running in the background"--no UI, no window.
>>>
>>> I can use a shortcut to the batch file and set it to run minimized if
>>> that is what you are thinking of - that would still leave an extra item
>>> sitting on the taskbar that I'd not want there though, with the same
>>> name as the actual program in this case, which would add to the
>>> confusion
>>
>>I thought Windows was a multitasking OS. Is there no way to start a
>>process completely detached from any GUI?
>
> I'm no expert but I think what you are describing can be done with a
> service.

Lawrence D'Oliveiro <_zealand> wrote:
>>>I thought Windows was a multitasking OS. Is there no way to start a
>>>process completely detached from any GUI?
>>
>> I'm no expert but I think what you are describing can be done with a
>> service.
>
> How is a "service" different from a "process"?

.... you need a root password to start a service?

butting

--
I am very new to programming drivers so if I sound un-knowledgeable
then it's because I am.
-- first4internet's Ceri Coburn on writing Sony's DRM rootkithttp://homepages.ihug.co.nz/~butting

Share This Page

Welcome to Velocity Reviews!

Welcome to the Velocity Reviews, the place to come for the latest tech news and reviews.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to chat with other enthusiasts and get tech help from other members.
Sign up now!