1.

Solve : batch file to delete files?

Answer»

ok i saw a batch file code on youtube when i was just surfing the videos, but i cant find it again, and what the file did was delete a file that u dragged into it, kinda like the recycle bin cept it deletes it straight away and doesn't ask if you WANT to delete it. can any one tell me what the code is, if they have anything similar???Code: [Select]@echo off

del /Q "%1"
sth like this ??Quote from: devcom on May 15, 2009, 02:17:33 PM

Code: [Select]@echo off

del /Q "%1"

erm, what does the /Q "%1" do?/Q
Quote
doesn't ask if you want to delete it

%1 is SET if you drag a file into script.batnice i DIDNT know that, thanks man well i ges that this will do the job thanksok it doesnt work, it SAYS cannot find the file path specifiedIn command prompt, type:

del /?If you want to delete both file and folder, please REMOVE rem.

Code: [Select]@echo off
if "%~1" neq "" (
del /f /a /q "\\?\%~f1" 2>nul
rem rd /s /q "\\?\%~f1" 2>nul
)


Discussion

No Comment Found