HELP ON COMMAND PROMPT

 by sharlston
images[3].jpg
This instructable will teach you how to make batch files,How to clear the text on cmd,Etc



If you need any help just personal message me or comment on the instructable
 
Remove these adsRemove these ads by Signing Up

Step 1: Making a batch file

images[3].jpg
To make a batch file you need notepad.
T open notedpad go to Start>All programs>Accessories>Notepad.

Open notepad then type what script you want such as:

@echo off
color 0a
title CMD Commander - By Sharlston
:Top
echo.
set/p "command= %CD%> "
%command%
goto Top

Then save it as the name you want such as cmd.bat make sure you put the .bat
Then select the dropdown menu at the bottom where it says txt and put it to all files and save it
When you open the batch file you made it should open in command prompt for exaple the one i wrote will make your own command prompt in just a few bites in size
mattyandchloe says: Aug 2, 2009. 9:36 AM
very impresed
sharlston (author) in reply to mattyandchloeSep 9, 2009. 12:50 PM
thanks
highvoltageguy in reply to sharlstonSep 8, 2012. 3:04 AM
In our school if there is a problem with a computer they ask me and i have some advice for you: 1. You really shouldn't be messing a around with CMD unless
you know exactly what you are doing (Microsoft implemented some serious commands including format etc. 2.People make viruses with batch files.there was once a virus NOT written in batch that was called CIH. It was made in memory of the Chernobyl accident by Chen Ing-hau or 陳盈豪. It activates on the 26th of april.
It cost 1 million dollars in commercial damages and was devastating to e-mail servers-Including intel. So there be careful out there i'm Christian an aged nine years old and computers are my favourite thing so seeya
Highvoltageguy signing out :)
daisyalan in reply to highvoltageguySep 20, 2012. 9:56 AM
arent you to a bit young to be on here??? :(
sharlston (author) in reply to highvoltageguySep 13, 2012. 11:09 AM
i got some news for you.9 year olds shouldnt be messing around with computers,im 14,i know what im doing,
highvoltageguy in reply to sharlstonSep 25, 2012. 11:09 AM
Hey mate don't get shirty with me i am just helping people who read the comments and i don't care how old you are it's not you're problem so please don't think you can boss me about.
YOLO
Highvoltageguy rules IMO
Prof. Pickle in reply to highvoltageguyJan 1, 2013. 7:10 PM
I had respect for you until you made a snide comment in reply to another persons stereotypical comment.

Also, why did you put "YOLO" there? It was out of context and disappointing.
highvoltageguy in reply to sharlstonSep 8, 2012. 3:04 AM
In our school if there is a problem with a computer they ask me and i have some advice for you: 1. You really shouldn't be messing a around with CMD unless
you know exactly what you are doing (Microsoft implemented some serious commands including format etc. 2.People make viruses with batch files.there was once a virus NOT written in batch that was called CIH. It was made in memory of the Chernobyl accident by Chen Ing-hau or 陳盈豪. It activates on the 26th of april.
It cost 1 million dollars in commercial damages and was devastating to e-mail servers-Including intel. So there be careful out there i'm Christian an aged nine years old and computers are my favourite thing so seeya
Highvoltageguy signing out :)
~KnexBuild~ says: Sep 10, 2011. 3:03 PM
in cmd just type in help and it will go to all the commands

I3uckwheat says: Dec 31, 2009. 5:45 PM
can you tell me how to pause for an amount of time please
TheBatchies in reply to I3uckwheatJan 21, 2010. 2:08 PM
If you want it like an animation,...

ping localhost -n 2 > nul

Or if you want it so they only have a few seconds to press a button before it does something,...

choice /c:12345 /t:5,10
if errorlevel 5 goto blah
if errorlevel 4 goto ha
if errorlevel 3 goto ba
if errorlevel 2 goto ma
if errorlevel 1 goto ta

The number after the comma tells how much time to wait. Hope this helped!
I3uckwheat in reply to TheBatchiesJan 22, 2010. 2:10 PM
ty i figured it out my self but ty
TheBatchies in reply to I3uckwheatJan 22, 2010. 3:07 PM
Oh, you're welcome. I was surprised to find out my friend was using

set /p command=

for one letter variables, where you have to type the letter than press enter. If you press something wrong, it either does something wrong or exits. If you have a one letter and you want to set a variable, you either do it in the program

set command=x

or if you want that variable to be inputted by the user and use it later on for data purposes. If you want to have the user input a variable if you simply want to go somewhere, you use the choice command. You don't have to press enter, and if you enter a wrong letter/number, it beeps! Also, you can time how long they have to input it before it does something, which is very useful in games.

Sorry, I talk too much.
knexer87 says: Nov 18, 2009. 7:36 PM
 is there a way to password protect a batch (real simple just exit if its wrong), and make a way to change the password and save it in the batch? if so would it work if i convert the batch to a .exe?
sharlston (author) in reply to knexer87Nov 19, 2009. 2:06 AM
knexer87 in reply to sharlstonNov 19, 2009. 1:43 PM
yes, like that but with a way to change the password and save it in the batch. 
something like 
:1
echo enter current password
set /p password=
if %password%-==%realpass% (goto 1)
echo enter new password
set /p realpass=

and then some way to save make "realpass" the new "realpass" every time it runs. even if there is another file with the password in it, i want to be able to do this.
TheBatchies in reply to knexer87Jan 21, 2010. 2:15 PM
Uhhh, maybe...

:Begin
if exist Password.txt (
goto Password
) else (
:1
set /p password=
echo %password% > Password.txt
goto Begin
:Password
set co= <Password.txt
set /p password=
if %password% EQU %co% (
goto somewhere
) else (
echo Wrong password.
echo.
echo Press 1 to go back, or exit in ten seconds.
choice /n /c:12
if errorlevel 2 exit
if errorlevel 1 goto Password

Hope this helped!
sharlston (author) in reply to TheBatchiesJan 22, 2010. 6:35 AM
nice have you go the surf 33 cheat code if you havent its a good addition
TheBatchies in reply to sharlstonJan 22, 2010. 11:57 AM
Haha, no clue.
TheBatchies in reply to TheBatchiesJan 21, 2010. 2:21 PM
Sorry, messed up.
at the bottom:

choice /n /c:12 /t:2,10
if errorlevel 2 exit
if erroelevel 1 goto Password
)

Sorry!
sharlston (author) in reply to knexer87Nov 20, 2009. 9:11 AM
erm i dont know try asking sejma hes good at batch
Sharlston Cat says: Oct 8, 2009. 8:41 AM
Matthew Could You Make An Instructable For Some More Scripts Like The Guessing Game or something plz thx
sharlston (author) in reply to Sharlston CatOct 12, 2009. 11:20 AM
heres the code

the cheat is surf33

@echo off
color 0e
title Guessing Game by sharlston
set /a guessnum=0
set /a answer=%RANDOM%
set variable1=surf33
echo -------------------------------------------------
echo Welcome to the Guessing Game!
echo.
echo Try and Guess my Number!
echo -------------------------------------------------
echo.
:top
echo.
set /p guess=
echo.
if %guess% GTR %answer% ECHO Lower!
if %guess% LSS %answer% ECHO Higher!
if %guess%==%answer% GOTO EQUAL
set /a guessnum=%guessnum% +1
if %guess%==%variable1% ECHO hey you won, the answer is: %answer%
goto top
:equal
echo Congratulations, You guessed right!!!
echo.
echo It took you %guessnum% guesses.
echo.
pause
TheBatchies in reply to sharlstonJan 21, 2010. 2:19 PM
It could also be:

:Random
set rnd=%random%
if %rnd% GEQ 101 goto Random
:Game
echo Welcome to my guessing game...!
echo.
echo Guess my number:
set command=
set /p command=
if %command% EQU %rnd% (
echo You guessed my number!
echo.
echo Press 1 to play again. Game exits in ten seconds if no arguement is given.
choice /n /c:12 /t:2,10
if errorlevel 2 exit
if errorlevel 1 goto Game
)


Yours looked pretty good too!
sharlston (author) in reply to Sharlston CatOct 9, 2009. 12:08 AM
you still want them?
ill send you the codes
Goodhart says: Sep 23, 2009. 8:53 AM
I know that both Vista and XP ( IIRC ) both have a simulated DOS command prompt, and DOS system inherent in the OS; but, are you certain that all of these parameters will run in the simulated version? In other words, they would work with systems pre-XP but do they work and do they work the same way within the XP / Vista OS systems? This is, I suppose, asking if you have tested this yourself to make sure they all work.
sharlston (author) in reply to GoodhartOct 9, 2009. 12:07 AM
well ive tried on xp and vista and they work
Goodhart in reply to sharlstonOct 9, 2009. 5:35 AM
That's good to hear :-) 
sharlston (author) in reply to GoodhartOct 9, 2009. 12:16 PM
i maybe not doing as much batch as im learning vbs
cammel8 says: Aug 8, 2009. 11:18 PM
sharlston (author) in reply to cammel8Aug 9, 2009. 5:03 AM
(removed by author or community request)
cammel8 in reply to sharlstonAug 10, 2009. 1:43 AM
So admittedly you are using it without siting whoever did the work originaly but its ok cause it was done by the other person first then you did it to him? Well now that I know that I feel so much better about it!
sharlston (author) in reply to cammel8Sep 9, 2009. 12:49 PM
what? i had it in a word doc on my usb which i found and made a ible about it
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!