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.

Basics of Batch Files

Basics of Batch Files
«
  • cmd window.jpg
  • cmd run.jpg
IF YOU HAVE ANY QUESTIONS, PLEASE POST THEM ON MY BLOG:
http://tamsanh.com/blog/2008/07/10/batch-tutorial-1-basics-of-batch-files/

I don't visit Instructables anymore, so you will get a faster answer that way.

Here is the basics of Batch files, specifically made for the group "Batch Lovers"

Batches are little files that run DOS commands in certain orders.

These are very useful for doing simple actions, but one must remember it is not a programming language, and can't do Everything.

Because batch files are simply DOS commands, let us get to know our text-based friend!

To access it, simply go to the Run Programs feature in your Start menu and type in CMD.

P.S.

If you like this Batch Tutorial, you should check out the
Slightly More Advanced Basic Batch Tutorial and the Advanced Batch Tutorial
 
Remove these adsRemove these ads by Signing Up
 

Step 1DIR Command

DIR Command
The DIR command is possibly one of the most useful commands one can use. And, to newer users, it looks quite haxxor, for lack of a better word. =D.

What this command does is it shows thie DIRectory, meaning all the files, and all of the folders that are present in a certain directory. This includes ALL files, no matter if they are hidden, or read only, or whatever, the DIR will show each of them. It will also show the memory taken by the directory, and the memory free. Though the latter is cut out of the image to show the command being used.

By using the DIR command, we can see the files, and folders that we may want to manipulate in the future with other commands.

« Previous StepDownload PDFView All StepsNext Step »
147 comments
1-40 of 147next »
Jul 12, 2007. 12:27 PMhq says:
s*** how do I get it back
Aug 17, 2010. 7:12 AMFiles says:
I lolled
Jun 24, 2009. 9:00 PMwill421 says:
Or rewrite the whole file.
Jul 14, 2009. 8:39 AMDNR says:
hey wen i open any of my drives a "open with" dialogue box opens...what to do to make it open normally
Apr 10, 2010. 9:07 PMGuard13007 says:
You're opening it with:

start "C:/something/"

yes? Something like that? Use:

start "C:/something/" "explorer.exe"

This makes it open with explorer, which is what I assume you meant.
Aug 24, 2009. 6:51 PMj.yeshe108 says:
I'm not sure really but in the list of programs to open the drives with try to find one that says something like "Open files with windows" that has a picture of a folder next to it
Oct 25, 2007. 2:03 AMarnoldtheduck says:
hey man, i can't get my shutdown batch file to run. it sorta flashes 4 a sec and then disappears. can u help me plz?
Dec 16, 2009. 10:45 AMAsk-Away15 says:

TRY THIS ONE INSTEAD! SIMPLE!

@echo off
echo (Your Message - Pull Them Into Pressing Another Button)
pause
echo (Your Message - Pull Them Into Pressing Another Button)
pause
echo (Your Message - Pull Them Into Pressing Another Button)
pause
shutdown -s -t 20 -c "Shutting Down"
:Top
echo (Your Message)
echo (Your Message)
echo (Your Message)
echo (Your Message)
echo (Your Message)
goto Top  

 

After This Is All Initiated, The Shutdown Is Unstopable, unless You Type Shutdown -a Into The CMD That Will Stop The Countdown Thus Stopping The Shutdown :)

By The Way You Dont Have TO Have 20 As The Shutdown Timer.. I Could Be 1 Second But Thats No Fun LOL Always Fun To Watch Them Like... WTF DUDE AHH WTF IS GOING ON.. lol

Dec 16, 2009. 1:19 PMarnoldtheduck says:
hey thanks a lot dude!
Sep 10, 2009. 6:18 PMpinkspeedo says:
no make sure it says shutdown -s -t (time here ) you dont need to pause if your shutting down..
Dec 19, 2007. 11:13 PMmunchman says:
You could add the line pause to the end of the file.
Apr 5, 2008. 6:56 AMmudkip4112 says:
mine keeps saying "path not found". what am i doing wrong?
Jun 24, 2009. 8:58 PMwill421 says:
Where are you going?
Aug 5, 2008. 11:59 AMfwjs28 says:
i was told about a command like netuser or something that changes the password..no questions asked...do you know what it is?
May 27, 2009. 7:19 AMwill421 says:
Errrmmm... Oh yeah, netuser. You said it your self and you were right!
May 27, 2009. 12:22 PMfwjs28 says:
uhh...yeah, ok...
May 28, 2009. 5:19 PMwill421 says:
Actually... I`m not sure...
May 28, 2009. 5:21 PMfwjs28 says:
i have the moments all the tim..hey ponies...
May 28, 2009. 5:34 PMwill421 says:
Ponies!??!?!?! ROFL LOL ROFL!!!!
May 28, 2009. 5:35 PMfwjs28 says:
wha? what ponies..all i see is a bunch of pink unicorns which are pink due to the everseeting sun at candy mountain
May 29, 2009. 12:28 PMwill421 says:
Still that`s funny. :D
May 29, 2009. 12:29 PMfwjs28 says:
very funny
May 30, 2009. 7:27 AMwill421 says:
Very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very funny!
Jun 1, 2009. 1:17 PMwill421 says:
At least it`s how it seems to me!
Jun 1, 2009. 1:19 PMfwjs28 says:
no....
Jun 2, 2009. 12:25 PMwill421 says:
???
Jun 2, 2009. 1:36 PMfwjs28 says:
bad kitty, Mah pot-pie!
Jun 2, 2009. 6:39 PMwill421 says:
MMMMMM.... I love potpie...
Jun 3, 2009. 12:18 PMfwjs28 says:
good kitty, you can have some a mah Pot-pie..
Jun 9, 2009. 3:33 PMwill421 says:
Meow! *Kitty smiles happly*
Jun 9, 2009. 3:38 PMwill421 says:
*MUNCH* *MUNCH* *MUNCH* Meow? (All the potpie is gone)
Jun 9, 2009. 3:40 PMfwjs28 says:
BOOM!
Jun 9, 2009. 3:35 PMfwjs28 says:
BOOM! Headshot!
Jun 17, 2009. 9:25 AMwill421 says:
*Computer sucks in kitty for revenge* *Kitty attacks BSOD and gets out* (Sorry I couldn`t upload the pic, my pc (or firefox) Is getting crappy.)
Jun 25, 2009. 9:24 AMwill421 says:
Here it is...
Jun 25, 2009. 6:36 PMfwjs28 says:
ahhhhhhhhhhhhhhhh...
Jul 1, 2009. 12:59 PMSuperBatch says:
Mwahahahahahhaa!!!
Jul 3, 2009. 8:16 AMfwjs28 says:
BUWAHAHAHAHAHA
Jul 1, 2009. 1:11 PMSuperBatch says:
Hmmmm... What should I do...? Oh yeah!
1-40 of 147next »

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!
22
Followers
5
Author:Neodudeman