Scripts Thread, Batch File to delete files. in Coding and Web Development; Hi,
I am trying to create a batch file to delete all the desktop.ini files from student home areas. I ...
9th June 2011, 11:31 AM #1
Batch File to delete files.
I am trying to create a batch file to delete all the desktop.ini files from student home areas. I have this code.
it seems to get rid of some of them but most remain. Does anyone have any thoughts please?
del /F /S "D:\Shared Folders\StudentHomeAreas\desktop.ini"
9th June 2011, 11:34 AM #2
Have you checked if it's giving you a yes/no to delete? I know force should stop it, but might be worth trying it with a /Q
Originally Posted by FN-GM
Also the ones that aren't deleting do they have indexing enabled on them?
9th June 2011, 11:37 AM #3
perhaps the ones it leaves are open otherwise locked?
what about doing something like havnt tested just thiking out loud
dir /b/s D :\Shared Folders\StudentHomeAreas\desktop.ini >d:\todelete.txt
for /f %%u in (todelete.txt) do (del %%u )
9th June 2011, 11:40 AM #4
Ah im aving a bad day, this did the trick. Typical as soon as i post here i get it sused!
del /F /S /A S "D:\Shared Folders\StudentHomeAreas\desktop.ini"
Thanks to FN-GM from:
jamiet147 (15th October 2012)
9th June 2011, 11:43 AM #5
- Rep Power
It might be some of the ini files are hidden or system
you might need to use attrib to unhide them or mark them as non system before deleting
By burgemaster in forum Scripts
Last Post: 23rd March 2011, 02:55 PM
By richrad_mills in forum Windows
Last Post: 23rd June 2010, 08:24 PM
By Aaron in forum Windows Server 2008
Last Post: 1st February 2010, 04:18 PM
By fil_b in forum Windows Server 2000/2003
Last Post: 5th November 2009, 05:13 AM
By russdev in forum Windows
Last Post: 19th November 2005, 10:51 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)