howtothings.co.uk

Full Version: (Batch) Useful batch commands
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Useful batch commands


STEP ONE:

In this tutorial you will be learning how to use the following commands:

cd
copy
del
start


STEP TWO:

cd

The cd command is used to navigate to a directory.

For example, if you wanted to navigate to be the desktop the command would be:

cd "%userprofile\Desktop%"


[Image: 5djy48.jpg]

This command is one of the more useful ones to know because it needs to be used in conjunction with the other commands.

STEP THREE:

copy

The copy command allows you to copy a file from one directory to another.

Before you are able to use the copy command, you need to know how to use "cd", this is because you need to be in the directory from which you want to copy the file from.

When using the copy command you need to use it in the following way:

copy "filename" "chosen path to copy the file to"

Where it says "filename", replace it with the name of the file you want to copy and where it says "chosen path to copy the file to", replace that with the directory of where you want the file to be copied to.

For example, if you've got a file called copy.txt that you want to copy to the desktop the code would be:

copy copy.txt "%userprofile%\Desktop"

[Image: i2k5eq.jpg]


STEP FOUR:

del

This del command is used to delete things, it can be used to delete single files or an entire hard drive.

Similar to the copy command, for the "del" command to work you need to cd into the directory where the file is.

When using the del command it takes the following structure:

del "filename"

Where it says "filename" replace that with the name of the file you want to delete.

For example, if you wanted to delete the file delete me.txt then the command would be:

del "delete me.txt"

[Image: 6puqew.jpg]


STEP FIVE:

start

The start command is used to start or open something, it can be a file or a program.

Just like the copy and del commands, for the start command to work you'll need to select a directory using the "cd" command.

Once the directory has been selected you type:

start "filename.extension"

Where it says "filename" replace that with the file you want to start / open - and where it says ".extension" replace that with the file type, eg .exe or .txt

For example, to start Internet Explorer you type:

start iexplore.exe


[Image: 2uqhqaf.jpg]


I hope this has helped.
Very helpful commands indeed,elementary which are normally required .
Good tutorial! cli is so important not just for hackers but just for using your computer in general, some programs like ruby run alot on cmd. Some *edit* most people don't even know what command prompt is, although i was pretty computer illiterate myself not to long ago so i shouldn't point fingers.

EDIT: 277 views + 2 post = WTF
On a very important note, why is Marks theme pink?
(11-02-2011, 11:32 PM)Drumm Wrote: [ -> ]On a very important note, why is Marks theme pink?

And why is that dude's arm around him on his facebook page?
And why did he block me on MSN.
Prolly cause you are questioning his pinkness!
(11-02-2011, 11:56 PM)Drumm Wrote: [ -> ]And why did he block me on MSN.

If it makes you feel better Drumm, I might send you a FB invite or give you my Google Talk ID
Yay <3 I feel loved.
(12-02-2011, 06:50 AM)Pack3t SynAck3r Wrote: [ -> ]
(11-02-2011, 11:56 PM)Drumm Wrote: [ -> ]And why did he block me on MSN.

If it makes you feel better Drumm, I might send you a FB invite or give you my Google Talk ID

Hey, why does Drumm get all that?
Pages: 1 2