How to delete a particular line from a file?

How to delete Temp file and Prefetch files via Batch command without deleting, and creating again Temp folder,?

  • i,m trying to clean temp files/ prefetch files withe Batch command, without compliantly deleting and creating again this folders. In other words go to folder select everything in it, and delete also try not to get error "can't continue this files are used by another program this is what i have so far %SystemRoot%\explorer.exe %temp%\ pause del %temp%\*.* pause %SystemRoot%\explorer.exe C:\Windows\prefetch\ pause del C:\Windows\prefetch\*.* pause it works, but it dos't delete some of the files, and leaves all of the folders intact in the %temp% folder. you also have to choose Yes or No Y/N to conferm the delete. this kind of defeats purpose of Batch file commands so i tryed adding this to delete command ↓ ECHO Y | del %temp%\*.* like it was suggested by this website http://www.robvanderwoude.com/del.php but it crashes immediately after seeing the line please help me figure this out. I thing this will be useful . and Sorry for broken English

  • Answer:

    del %temp%\*.* /s /q the /s means to delete files in all of %temp%'s subdirectories also the /q means "quiet" or in other words: it won't prompt "are you sure? blah blah. . ." There is no want to forcefully delete a file that is being used by the processes - it must be important. You can use >nul at the end of your del command to make it not display anything too.

kademi at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.