Starting Programs with a Batch File

  • Thread starter Thread starter joshoberg
  • Start date Start date
J

joshoberg

I know this seems like an easily answered question, but I cannot seem
to get it right. Im trying to open\close individual programs with a
batch file. This is what I've typed:

@echo off
echo Hello there
pause
start C:\ProgramFiles\Trillian\trillian.exe

I'm trying to start Trillian, but I get an error everytime I run this.
"Windows cannot find "C:\ProgramFiles\Trillian\trillian.exe"". This is
the correct location, why isnt it working?
 
That worked thanks. But how do I stop programs like this. I've tried
these:

@echo off
echo Hello there
pause
NET STOP "trillian"

-and-

@echo off
echo Hello this is josh
pause
NET STOP "C:\ProgramFiles\Trillian\trillian.exe"

Nothing happens with either of them. Whats wrong?
 
AFAIK, net stop won't stop any programs other than
a few that are part of the OS plus some XP services.

type "net" /?
and net stop /?
to see.

You can't just "stop" most Windows programs, they
have to be closed by the X or by the file>>exit command so
they can exit properly and clean up.
 
net stop is for services/ drivers you can use kill.exe or for a more
graceful way;
http://www.hiddensoft.com/AutoIt/

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

| That worked thanks. But how do I stop programs like this. I've tried
| these:
|
| @echo off
| echo Hello there
| pause
| NET STOP "trillian"
|
| -and-
|
| @echo off
| echo Hello this is josh
| pause
| NET STOP "C:\ProgramFiles\Trillian\trillian.exe"
|
| Nothing happens with either of them. Whats wrong?
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top