Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Bat files & opening programs  (Read 7516 times)

0 Members and 1 Guest are viewing this topic.

1bd4t6h

  • Guest
Bat files & opening programs
« on: January 09, 2008, 05:35:31 PM »
Hola mis amigos.
I have run across a problem when it comes to opening a program in a batch file. I would like to open a program that is located in "C:\Program Files\Microsoft Visual Studio\COMMON\MSDev98\Bin\MSDEV.EXE"
heres what my batch file looks like now...

@echo off
tskill msdev
tskill msdev
START /MAX "C:\Program Files\Microsoft Visual Studio\COMMON\MSDev98\Bin\MSDEV.EXE"

oh and by the way I want those tskills :).

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Bat files & opening programs
« Reply #1 on: January 09, 2008, 06:20:04 PM »
Quote
I have run across a problem when it comes to opening a program in a batch file

Care to explain. Batch file looks fine. Are you getting any error messages? What happens when you run the file?

 8)

PS. Why kill msdev twice? Once is not enough?
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

1bd4t6h

  • Guest
Re: Bat files & opening programs
« Reply #2 on: January 09, 2008, 07:14:26 PM »
Well when it's in " it will just make the Command prompt maximized. But if I don't put the " marks then I get Windows cannot find 'c:\Program'. I use two tskills because in Microsoft Visual studio C++ it crashes often and you have to kill the process twice :/. So I want this program so I can just push a key combination and just end the task and bring it back.

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Bat files & opening programs
« Reply #3 on: January 09, 2008, 07:34:36 PM »
The quotes are required because the path has embedded spaces. The start command can be quirky....when it sees the quotes it assumes they're the window title. You can get around it by using null title quotes:

Code: [Select]
@echo off
tskill msdev
tskill msdev
START "" /MAX "C:\Program Files\Microsoft Visual Studio\COMMON\MSDev98\Bin\MSDEV.EXE"

Good luck.  8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

1bd4t6h

  • Guest
Re: Bat files & opening programs
« Reply #4 on: January 09, 2008, 10:59:50 PM »
Hey thanks! that worked :D.