0

I remember I used to write in a .bat

call myprog.exe

But dos says call not a command ?!!

My question is not about cmd prompt but BATCH file.

I tried also

c:\some-path\myprog.exe

and

"c:\some-path\myprog.exe"

the error message: the exe is not a recognized internal command. It is a console application made in C# which runs if I launch it directly in cmd prompt not in batch

Update: the 2 first character ouput is weird there are some weird 2 chars I think it happens since I installed msysgit client http://code.google.com/p/msysgit/ which has somehow made something to command prompt.

Hope I can uninstall it...

I uninstalled it but still got the weird chars in front of my command:

'´++"C:\some-path\prog-example.exe"' is not recognized ...
user310291
  • 36,946
  • 82
  • 271
  • 487

5 Answers5

2

You have include full path for the exe file. Also if any of your directories in the path has spaces, don't forget to include the whole text in quotes.

Example:

C:\Program Files (x86)\Winamp\winamp.exe

Note: If you create a batch file and does not work as you expected. Run the batch file from command prompt and it will display the error message.

Shoban
  • 22,920
  • 8
  • 63
  • 107
  • I tried the error message: the exe is not a recognized internal command. It is a console application made in C# which runs if I launch it directly in cmd prompt not in batch – user310291 Jan 16 '11 at 21:13
  • like I said.. Did you include the full path? – Shoban Jan 16 '11 at 21:15
  • 1
    Does your program depend on any other DLLs, etc. that are in the same working directory? A batch file by default isn't going to move your working directory to the location of the program. – Joe Jan 16 '11 at 21:18
  • ok I think mysgit client has done something to my command prompt so it doesn't work any more. – user310291 Jan 16 '11 at 21:23
1

You can also use

myprog

No need for the full path as long as it's on the PATH.

Axel Fontaine
  • 34,542
  • 16
  • 106
  • 137
1

"call" is only used for running another batch file.

As shoban says, just use the name of the .exe

Martin Beckett
  • 94,801
  • 28
  • 188
  • 263
1

Use the built-in start command.

CesarGon
  • 15,099
  • 6
  • 57
  • 85
0

You could try using cmd /c X:\path_to\myprog.exe

Fred
  • 402
  • 4
  • 9