[Tutor] Cmd Advice

Walter Prins wprins at gmail.com
Sat Feb 11 14:54:30 CET 2012


Hi Dave,

>> You need to learn how to create a DOS window (or cmd window, just another
>> name for same thing) in Windows.  One way is to use the RUN prompt in the
>> Start menu, and run the program  CMD.  Another is to go to the Start
>> Menu->Accessories->DOS box.  it's been a long time since I ran Windows, so
>> it may have some different name, but it should be in your accessories
>> somewhere.  Since I use such a shell constantly, I created a shortcut key to
>> open one.

>  I did mention very early on in my query that I had restricted access to the
> Dos CMD prompt, hence why I asked if anyone knew how to create a self
> contained prompt within the Python program. I was under the impression that
> the .bat file Walter described would fill that gap.

OK, I thought you said you already knew how to get a cmd.exe shell
despite the blocks in place (via a batch file) yourself.  The batch
file I suggested was not meant to work around your cmd.exe issues, it
was meant to smooth out the calling of the python program so that,
once having a command prompt, you could use the t.py program
identically to how you would use it on Linux, while still allowing you
to tinker with the code as well.    As an aside, the least desireable
idea would be to modify t.py, or write another python program, to
simulate cmd.exe in order to work around the cmd.exe block.  As Dave
has posted, if you can create batch files, then cmd.exe is available
to some extent, the goal is to trick the system into running cmd.exe
interactively, possibly via a batch file as intermediary, without
blocking it and thus allowing you to continue to use it.

So, regarding getting a working command prompt, several options have
been mentioned already but I'll just chip in and suggest the
following:

1) Create a batch file (call it, say, "shell.bat") and put in it:
c:\windows\system32\cmd.exe

Double clicking this should run cmd.exe and present a normal command
prompt.  If this works, then create a shortcut on your desktop to this
batch file and you're done. (You would probably want to add a line to
add the location of the t.py program into the PATH environment
variable into this batch file, to allow you to run the program from
any working folder.  If you don't know what I'm on about post back and
I'll explain.)

2.) If no.1 fails, then the next idea is to try making a copy of
cmd.exe from c:\windows\system32\cmd.exe into your own home folder,
and call it something else, say "shell.exe".  This should evade the
cmd.exe blocks in place (depending on how thorough they are.)  Try
directly running this by double clicking.  This should open up a
normal command prompt as well.

Let me know if either of those options work for you.

Cheers,

Walter


More information about the Tutor mailing list