Jump to content

Recommended Posts

Posted

Hi,

 

I am trying to create a batch file to delete all the desktop.ini files from student home areas. I have this code.

 

del /F /S "D:\Shared Folders\StudentHomeAreas\desktop.ini"

 

it seems to get rid of some of them but most remain. Does anyone have any thoughts please?

 

Thanks

Posted
Hi,

 

I am trying to create a batch file to delete all the desktop.ini files from student home areas. I have this code.

 

del /F /S "D:\Shared Folders\StudentHomeAreas\desktop.ini"

 

it seems to get rid of some of them but most remain. Does anyone have any thoughts please?

 

Thanks

 

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

 

Also the ones that aren't deleting do they have indexing enabled on them?

 

Steve

Posted

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 )

Posted

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 1
Posted

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...