Making .bat File Need Help Please

Status
Not open for further replies.

MackAttack

In Runtime
Messages
193
Hey I've been messing around with trying to make BATCH files...but no luck..

for example if I wanna delete something like say I wanna delete a file which is on my C drive called Songs....how do I do that?...I read some things on the internet and this is what I wrote down:


cls
deltree /y C:\SONGS
cls
EXIT


it won't work??? I don't know why im probably missing something but I don't know what...if anyone could give me some pointers or how to get this to delete would you let me know thanks..or if this isn't wrong what am I doing wrong that wont make this delete that specific folder...

thanks :)


also after I create this batch file is tehre anyway I can change the icon so it looks like an Image icon??? or like just any other icon??

thanks
 
MackAttack said:
for example if I wanna delete something like say I wanna delete a file which is on my C drive called Songs....how do I do that


del songs /Q


del - command, delete one or more files
songs - argument, in this case the file to delete
/Q - switch, turn on quiet mode for no prompts
 
cool thanks

but don't I have to put like C:/songs???? so it knows where the folder is located?

thanks
 
the code i posted earlier will delete a file named songs

to delete a dir you will need to use rmdir

Code:
C:\>rmdir /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

    /S      Removes all directories and files in the specified directory
            in addition to the directory itself.  Used to remove a directory
            tree.

    /Q      Quiet mode, do not ask if ok to remove a directory tree with /S
 
like say I wanna delete a file which is on

A FILE requires an extention.

EG: My_Resume.doc
where .doc specifies that it is a document used by MS Word

Another EG: (Just in case) MyBatchFile.BAT
where .BAT specifies that it is a Batch file and is to be executed by a command.exe/cmd.exe

Hope that helps!!!
 
he can also use wildcards.

* for any single or multiple amount of characters. example: *.* for any file with an extension

? for any single character. example: greenday?? for files like greenday01, greenday02, greenday03
 
Status
Not open for further replies.
Back
Top Bottom