batch - Custom commands? (python, cmd, etc.)

07
2014-07
  • James Lynch

    I was wondering if there was any possibility that I could make a command that does something that standard commands couldn't do, like the ipconfig command. Is this possible?

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    windows - Opening Python in CMD (Unfixable Error)
  • Robert

    I recently tried opening one of my Python projects with CMD to see what would happen. The result did nothing amazing, but Windows 7 thought I wanted to open .py files in CMD all the time.

    I have tried everything, setting it back to python.exe does not work, I even went to Control Panel to see if it could help, but Control Panel couldn't help either. So if someone could help me please that would be great.


  • Related Answers
  • njsg

    I'm not a windows user, so I may be wrong here. But at least under UNIX, the python executable is just an "interpreter", just like other UNIX shells. Like many tools out there, it reads and writes from and to standard input and output+error.

    It is not a terminal by itself, these programs need to be attached to a terminal (be run from a terminal) — or a terminal emulator, as you do under X Windows System or the Microsoft Windows graphical interface.

    So, without any specific knowledge of Windows, I'd guess you need to start python.exe through a terminal emulator. As cmd.exe really opens a window when it's invoked from the Windows graphical shell, I'd try either setting the command to open python scripts as cmd.exe python.exe, or cmd.exe with parameter python.exe.

  • 02strich

    If you open the properties page of a python script you should see the associated application for running this type of file in the upper half. There should also be a change button.