logo elektroda
logo elektroda
X
logo elektroda

Running program.exe from command line: 'not recognized as command' error explained

zbyniu 128385 21
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 2333874
    zbyniu
    Level 15  
    How to run program.exe from the command line.
    Writing the full path in the line run the program starts, from the command line I enter the directory of the exe file and the attempt to run ends with the following information: The name is not recognized as an internal or external command executable program or batch file
  • ADVERTISEMENT
  • #2 2333904
    chyzio
    Level 14  
    type cmd in run
    and then, as in dosie, you navigate through the directories
    cd directory - change path to 'directory'
    cd .. - it is a directory below
    filename.exe - runs the file, if it can be run in the dosa environment
  • ADVERTISEMENT
  • #3 2333944
    zbyniu
    Level 15  
    So I did and the result is as described.
  • #4 2333987
    chyzio
    Level 14  
    since dos writes that "Name is not recognized as an internal or external command executable or batch file" then it is right! you probably make a typo or run from another directory, it can be 1 directory further with the same name

    e.g:

    c: \ directory \ directory \ directory \ prog.exe

    and you type in, for example: c: \ directory \ directory \ prog.exe

    I do not see any other possibility
  • #5 2334704
    zbyniu
    Level 15  
    I rewrite the path 1: 1 to the command line and to the run field. Only in the second case it started.
    I need to make a * .bat file that runs a winxp program.
  • #6 2334816
    mmm777
    Level 31  
    1) Are there any spaces in the path or program name? Because as it is, the whole thing is in the ears: "\ xxxxx.exe"

    2) Do not rewrite from the `` Run '' box, just select and copy, then in the console window `` insert ''

    3) Does what you want to run have the .exe extension for sure?
  • #7 2334966
    zbyniu
    Level 15  
    I copy the command from the shortcut to the * .bat file and vice versa. The hotkey works whip no. Same with the command line. There is no question of no spaces.
  • #8 2335065
    mmm777
    Level 31  
    Hmm ....
    And entering the command as it was in `Run 'to the START command changes something?
  • #9 2335128
    paweliw
    IT specialist
    Why do you need a bat file? Shortcut is not enough?

    Most of the programs launched from the bat file require the computer to "set itself up" in the program directory, otherwise there will be errors.
    For example, we want to run the G: \ Directory \ directory3_0 \ directory.exe file.
    Entering the line in the batch file (bat):
    G:\Katalogowanie\spis3_0\spis.exe

    will run the program, but an error will occur because the program has G: \ Cataloging \ list3_0 \ as the working directory, which has not been obtained in the batch file. In this case, you would need to add the application directory to the Path environment variable, which is not convenient under XP.

    However, creating a bat file with the following content:
    g:
    cd Katalogowanie
    cd spis3_0
    spis.exe

    will run the program without error because the computer "set itself" in the working directory of the application.
    This is also how the shortcut works, in addition to the directory with the executable program, it also "sets" the working directory of the application in accordance with the directory in which the program is located.

    It should also be added that if directories / file have a space in their name, they must be enclosed in quotation marks.

    I think this will solve your problem.
  • #10 2335303
    zbyniu
    Level 15  
    Regarding the path:
    in the command line I go from directory to directory and finally enter the name from .exe and it does not start, just writes Name is not recognized as an internal or external command executable program or batch file.
    In addition, this does not apply to all programs, e.g. winamp starts normally from the command line.
  • ADVERTISEMENT
  • #11 2336313
    paweliw
    IT specialist
    Maybe write what the program is, but in my opinion you are making a mistake.
    After entering the program directory, enter dir / p , a list of files available there will be displayed, check if the name you are typing is there.
    You don't need to add an extension because files with the same name are executed in the order * .exe, * .com, * .bat.
    I still don't know what exactly you want to achieve because you don't want to write it.
  • #12 2336718
    zbyniu
    Level 15  
    If you have winXP, run cmd.exe
    One by one, start running the programs you have on your computer.
    Some of them will not start, then you will know what I'm talking about.
  • #13 2340370
    Zuchan
    Level 16  
    It happens that the Elevator does not know how to interpret the entered command, e.g. due to intense mixing in the system. Question: do commands like ping, netstat, ipconfig also fail and end with a similar message?
  • ADVERTISEMENT
  • #14 2340473
    paweliw
    IT specialist
    zbyniu wrote:
    If you have winXP, run cmd.exe
    One by one, start running the programs you have on your computer.
    Some of them will not start, then you will know what I'm talking about.


    I wonder what do not start for you, because for me they all work.
    Not counting of course the programs that display the appropriate error message. Enlighten me because I don't know what you're talking about.

    Zuchan wrote:
    It happens that the Elevator does not know how to interpret the entered command, e.g. due to intense mixing in the system.


    This has not happened to me yet, the correct commands / files are being executed correctly. Otherwise there is an appropriate message.
    The easiest way to explain every Windows ailment is that the system is stupid, usually the user makes mistakes.

    Don't confuse people with imaginary stories.
  • #15 2340877
    Zuchan
    Level 16  
    "Do not confuse people with imaginary stories." Well, sorry, here, my friend, exaggerate a bit, accusing me of making up a story. For several nice years of playing with computers, I encountered various situations, including those that Paveliw had not heard of. This does not mean that they could only appear in imaginary stories. Specifically: a more advanced user did not like the restrictions imposed by the network administrator and tried to use his business PC according to his preferences at all costs. He booted Linux from a bootable floppy, allowing himself to install software, search for passwords, etc. The result was that Windows did strange things on the machine, eg the ping command in the command line ended with the same message as the author of this thread quoted. In order to correctly execute the command, it was enough to run cmd.exe from its location: C: \ WINDOWS \ system32. And that's all my "confuse people's mind". I greet those who think differently.
  • #16 2341472
    paweliw
    IT specialist
    Zuchan wrote:
    ... He booted Linux from a bootable floppy, allowing himself to install software, search for passwords, etc. The result was that Windows did strange things on the machine, eg the ping command in the command line ended with the same message as the author of this thread quoted. ...


    Don't be confused, if you start your computer from any boot floppy disk, the operating system is the floppy booted system, not the one on the hard disk.
    Then all sorts of things can happen, but that is not the subject of this topic!
    Here we are talking about the command line in XP, if the user was messing with his system, he would probably inform us about it, otherwise we can only guess what happened.
    I know that people do different things with their system, I've already seen a lot, but in case of problems you have to write about it, nothing like that happened here.

    dismissal finally write what program does not want to run, maybe we will find out what is the cause of your problems.
    Writing generally that something won't start goes nowhere.
  • #17 2341517
    rybart
    Level 23  
    zbyniu wrote:
    I copy the command from the shortcut to the * .bat file and vice versa. The hotkey works whip no. Same with the command line. There is no question of no spaces.


    So there are spaces in the name !!

    When calling this applet, write its name into quotation marks.

    Example:

    If the notebook with notepad you will change the name to note pad then to run it from the command line or from inside a bat file you have to type "note pad" .

    The same goes for paths:
    e.g:
    "C: \ Program Files \ Microsoft Office \ Office10 \ excel.exe"
  • #18 2341548
    paweliw
    IT specialist
    Rybart :arrow:

    I have already written about the necessity to put paths to directories / files with spaces in the name in quotation marks.
  • #19 2341614
    rybart
    Level 23  
    Faktor paweliw ale: "The words teach examples draw"
  • #20 2341975
    paweliw
    IT specialist
    rybart wrote:
    The fact is Paweliw but: "verba docent, exemp trahunt"


    I understand my love for Latin but this is a forum Polish , it was not enough to write: words teach, examples attract (captivate) ?
  • #21 3716341
    holcer
    VIP Meritorious for electroda.pl
    Hello. Is it possible to copy text in windows (in the graphical interface) and then run the command line and paste it? Please help.
  • #22 3716344
    Kolobos
    IT specialist
    You can, in the properties of the cmd window, you set the quick edit mode, and then with the right mouse button you paste what you want to the cmd window.

Topic summary

To run a program from the command line, navigate to the directory containing the executable file using the `cd` command. Ensure the correct path is entered, as typos or incorrect directories can lead to the error message "The name is not recognized as an internal or external command, executable program, or batch file." If the program name or path contains spaces, enclose it in quotation marks. For batch files, ensure the working directory is set correctly to avoid execution errors. Users have reported that some programs, like Winamp, run without issues, while others may not due to various system configurations or restrictions.
Summary generated by the language model.
ADVERTISEMENT