answersLogoWhite

0

REM deletes a file

C: del filename

exit

Create a file, above, using wordpad and save it with the extension .BAT

Modify the line C: del filename, to indicate where the file is and instead of 'filename' write the name of the file you want to delete.

(REM is just a remark to remind you what it does..)

Say you call the batch file 'deleter.bat', then you have to include this file name in the startup program file.

This will depend on what operating system you are using.

Old DOS, would use an autoexec.bat file.

You could then actually add the delete command in with the autoexec.bat file.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you get a batch file to delete a directory when it says Acess is Denied?

If it says access is denied that means that access is deined, you can't delete it. I think you are probably trying to make a batch file virus to delete system files and is trying to make the batch file delete everything, but came into the access is deined problem.


How do you remove a batch file?

Delete it...


How do you make a batch file to move files?

in your batch file type: Move (the directory or folder and the file) space (the directory you want it in) example: move "C:\Users\%username%\Desktop\text.txt" "C:\Users\%username% You can change the %username% to your username but %username%is the variable for your username


How do you delete a file or directory in Linux?

rm filenameorrm -r directoryname


What are five unix commands?

cp - copy a file rm - delete a file mv - rename a file mkdir - create a directory rmdir - remove a directory etc...


You are deleting a file from batch file Somehow the delete function not deleting some time?

Some files can be protected from being deleted either because they are important system files or belong to a person who protected it, so if you don't own the rights for the file/folder you wish to delete, the batch file will not delete and will just say "Access is Denied".


How To create Directory Using Batch File?

You can make a folder with batch by using the command: md Foldername Example: @echo off md WikiAnswers exit The batch file would make a folder named WikiAnswers, and it would appear on your desktop


How do you delete 0 byte files using DOS?

The command for deleting a file in DOS is DEL. If the file you are trying to delete is in the current directory, type DEL followed by the full filename. E.g. del file001.txt If there are multiple files, the wildcard * can be used. del file*.txt will delete all the text files that start with 'file' del file*.* will delete all the files that start with file. del *.txt will delete all the text files. del *.* will delete all the files in the current directory. It is possible to delete files in another directory by typing the full path and filename del c:\folder01\*.* will delete all the files in the directory c:\folder01\ DEL will not affect hidden files, but careless use of this command could damage your operating system so use with care.


How do you use batch files to copy files from the same folder as the batch file?

Ah, darling, it's as easy as pie. Just whip up a batch file with the command "copy %~dp0*.* destination_folder" and voilà, you're all set to copy those files from the same folder. No need to break a sweat, it's a piece of cake!


How can you delete an infected file called windows nem218 dll?

i deleted this from my windows millennium edition computer by booting up in dos with the starup disk changing to the windows directory and typing del nem218.dll i had 3 other files i needed to delete the same way everything seems to work good now


Booting file of win vista os?

what is booting file win vista


How do you make a batch file to delete all files and folders in a particular folder?

The command is as follows : del c:\[directory you want to delete] /s This would need to be in a text file created in notepad, and saved as a .bat file. Or you could type EDIT from the command line to bring up the old DOS editor. Improving answer: Step 1: Open up Notepad Step 2: Type the following code in: @echo off deltree [Your hard drive, usually C:]\[Directory you want to delete /s for quietly Step 3: Save as "whateveryouwantwithoutquotes.bat"