Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I have a batch script (below) that I put in the task scheduler to make sure FrostWire file sharing starts again when my Mom turns it off.
I need to know how to tell it to look and see if FrostWire is already running, and if it is, then don't try to run it again. Something like:
if %frostwire%==yes goto exit
(I found that here: http://aroundcny.com/Technofile/tex... )
What should I do?
Thanks much,
Martin
Here's the script so far:
min
"C:\Program Files\FrostWire\frostwire.exe"
sleep 10
window.exe /MIN "FrostWire: Enabling Open Information Sharing"

Hi Martin,
I don't mean to rain on your parade, but nothing in that batch looks familiar.
But it's worse than that. The WINSET used on that page is [AFAIK] a DOS app and probably won't effect the "global environment". Some things which try to mess with NT will generate a error like "blabla has attempted..." others will simply be ignored.
=====================================
If at first you don't succeed, you're about average.M2

You can do it with a third-party command line process explorer. Then your script would run the command with whatever switch is needed to print the current running processes. Then pipe that through findstr "frostwire.exe".
Here's a sample script:
@echo off
process | findstr "frostwire.exe"
if errorlevel 1 (
goto start) else (
goto :eof
):start
start %programfiles%\frostwire\frostwire.exeI think you'll get the idea.
"Computer security." — Oxymoron

How cool, tonysathre,
I have a working script that does exactly what I want. I had to go download process.exe.
Thanks for your help (:
Here's the script for anyone else:
::MINIMIZE THE COMMAND WINDOW...
MIN
::FOR THE findstr, LETTER CASE SEEMS TO BE IMPORTANT. JAVAW.exe IS FROSTWIRE
process.exe | findstr /C:JAVAW.EXE
if errorlevel 1 (
goto start) else (
goto eof
)
endif
::NOT SURE IF endif MEANS ANYTHING
:start
::THESE MAKE SURE FROSTWIRE MINIMIZES AFTER STARTING, AS FAST AS POSSIBLE, NO MATTER HOW LONG IT HAPPENS TO TAKE TO START
"C:\Program Files\FrostWire\frostwire.exe"
sleep 3
window.exe /MIN "FrostWire: Enabling Open Information Sharing"
sleep 5
window.exe /MIN "FrostWire: Enabling Open Information Sharing"
sleep 8
window.exe /MIN "FrostWire: Enabling Open Information Sharing"
sleep 10
window.exe /MIN "FrostWire: Enabling Open Information Sharing":eof

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |