3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Circumvent restrictions on CMD.exe or DOS prompt

Ever been on a computer where you did NOT have permission to run "cmd.exe" in order to operate in DOS mode? Maybe you didn't have the option to click "Start" -> "Run"? Do what you want with a simple batch file despite these silly restrictions.

Addendum: This method was used to provide a shell-like interface on an XP machine running Citrix server. The "full desktop" application was published (looks like Remote Desktop) but wouldn't let me use the shell due to security questions. Many have wondered why exactly I did what I've done below, so now you know the context.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Create the batch file

Create the batch file
The first step is to create the batch file. Create a new file on your desktop and name it "shell.cmd" or "dos.bat". Name it anything you like as long as the file extension ends in .cmd or .bat.

Inside the file, put the following code:

@ECHO OFF

REM make all environment changes local to the execution of this script.
SETLOCAL
REM show customized welcome message, version of Windows and a blank line
@ECHO --== Welcome to your customized DOS Batch Shell ==--
VER
ECHO.

REM create loop block where user is prompted for a command and
REM that command is executed, displaying the results.
:cmdloop
REM Display working dir prompt, asking for a command.
@set /p USERCMD=%CD%!
REM "quit" or "exit" will both exit this shell.
@IF "%USERCMD%"=="quit" GOTO END
REM execute the received command.
%USERCMD%
REM go back to the beginning of this block.
@GOTO cmdloop

:end
REM end local environment changes
@ENDLOCAL

REM pause briefly before closing this window
@pause
« Previous StepDownload PDFView All StepsNext Step »
28 comments
Apr 28, 2012. 12:00 PMAlexamon says:
if you can make a command prompt in a batch, you must have cmd not blocked on your computer, or else its crap
Jun 10, 2010. 10:04 PMmr.break_it says:
At the end of your prompt line, there is an exclamation point, to the life reads like: F:\! I know the greater than sign does not work, but i much prefer the right squigly bracket (}) to the exclamation point because it more closely resembles what cmd should look like. Perhaps people want to change the exclamation mark on line 12. let me know if you like this.
Aug 7, 2008. 12:04 PMcrudeplatypus says:
um, how about in notepad "start" and save it as a .bat file n your desktop/ much easier
Aug 30, 2009. 10:45 AMNetDex says:
That command is blocked. It is too simple to leave it alone. So the administrator blocked it.
May 14, 2008. 10:56 PMLiquidCheese says:
I might know a quicker way to get restrictionlessly in MSDOS: open notepad, typ COMMAND.COM, then save it as a batch or command file. What you made up is unique, but I'm just saying there's like.. a quicker way to get into MSDOS. Well done anyway. ;-)
Aug 17, 2009. 5:50 PMcheatman093 says:
if your adminitsrator blocked Command Prompt that wont work
Apr 22, 2009. 3:21 PMwill421 says:
Uh... An error will pop up because you`re trying to get cmd.exe(of course).
Aug 20, 2008. 10:32 AMClCrow says:
Well, the computers at the library I go to won't even allow you to save a batch file. Any way to get around that?
Apr 26, 2009. 4:11 PMwill421 says:
Save as .txt and right click go to open with --> Command prompt
May 21, 2008. 2:41 PMTheWelfareWarrior says:
heh, My school just protected cmd because kids (like myself) were remotely shutting down computers. They thought they solved the problem... but the way they caught us was by looking at which programs were opening and at what time. so now I need to find an instructable for that.
Jan 10, 2009. 10:54 PMjchar77 says:
Ha! That would be so fun! I wish my school administrator is dumb enough to leave command alone! Good one!!!!
Jul 11, 2008. 5:09 PMgirrrrrrr2 says:
try a program called "run as date" (google to find it) this program may allow you to set up the program to look like you were using it 3 months ago... lol... and if that doesnt work than um... idk what you can do... but i am gonna try to steal classmates passwords using a flash drive that has been case modded to look like it is a usb cable... and then i will be using a program called REFOG. anyone have any better programs that i can use? (sorry to ask a question in a response)
Jan 10, 2009. 10:55 PMjchar77 says:
Keyloggers can seriously damage your computer. I would reconsider what you use
Mar 29, 2008. 12:57 PMHardCoreHacker says:
I'm using a Vista and I do not know how to make a "file"
Nov 28, 2008. 3:51 PMthegeeke says:
Maybe you should change your user name... or try C++ and learn :). otherwise, right-click your desktop and go to "new"
Jun 26, 2008. 12:58 PMfwjs28 says:
jeesh
Jul 24, 2009. 12:44 AMmemyselfand1 says:
Hah, they disabled control panel on the new computers, as well as run, search and deleted all the games.
Sep 26, 2009. 9:50 AMcrudeplatypus says:
if you are running xp, right click on the desktop and go to new---> .txt file, that should let you make a script....
Sep 26, 2009. 7:10 PMmemyselfand1 says:
won't work. when ever it opens up an instance of cmd, in any form, it says "this has been cancelled due to restrictions in place on this computer".
Nov 20, 2008. 7:10 PMArbitror says:
Here is how to do a greater than sign: >. You can also do that for <, |, etc.
Nov 20, 2008. 7:12 PMArbitror says:
oops! like this:
>
Nov 20, 2008. 7:15 PMArbitror says:
OK, this isn't working! type a circumflex accent (capital 6) followed by the greaterthan sign. Also works for lessthan(>), and pipes(|).
Oct 31, 2008. 5:22 PMBatchMan says:
i made my own version of ms-dos links to internet to get commands so file is small. i will e-mail to ppl if u pm me
Nov 20, 2008. 7:06 PMArbitror says:
Would you mind pming it to me?
Oct 13, 2008. 10:03 AMcollard41 says:
this is a good instructable. because it actually works!!
Mar 29, 2008. 1:54 PMrimar2000 says:
Very nice.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
2
Followers
5
Author:Kozz
A programmer ever since I laid my hands on a TRS-80 writing BASIC programs like mad-libs in 1990. Goes back to 1984 if you count my trance-like state induced by a PET computer. Now I get paid to do ...
more »