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.
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".
Delete it...
application
For Unix/Linux, consider the following: # Check to see if directory specified by user exists if [ -d $1 ]; then echo $1 is a directory and exists fi In Windows: if exist "Directory\" echo Yes
You cannot undo a delete.
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
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
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.
You can just delete hidden files with the same del command, but since the files are hidden you need to map the location of the hidden folder in the command so the batch file knows where to look and delete. @Echo off del "location of hidden files and/or folders" /Q /F /S exit
Make a new text file and rename it to _____.bat (fill in the blank with a name of your choice). I'm assuming you know how to change file name extensions. Right click on the .bat file. Choose 'edit'. type this: del " __A___ \*._B_" fill in blank A with the directory name fill in blank B with the extension of the file type you want to delete or '*' for all files. EXAMPLE del "C:\New Folder\*.*" - this will delete everything in the folder OR del "C:\Another Folder\*.jpg" - this will only delete files with the jpg extension Now you can save the batch file and run it.
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"
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!