Jump to content

Recommended Posts

Posted

Hello All,

 

I have just moved all over our student and staff files from our old server to our new one with robocopy, but I it has now set all hidden files as visible. I am now getting lots of requests about students work not working but when I go to them it seems that a lot of them have files that start with a ~$ and then the correct file. I assuming this is to do with autorecovery or something as they all seem to be office documents.

 

Is there an easy way of having a script which deletes all files starting with ~$ in a directory and all of its sub directories while leaving all the other files in place?

 

Kind Regards

Posted (edited)

Wouldn't something simple like this work?

 

FOR %%A in (\\server\share) DO (IF %%A == ~$*.* DEL %%A)

 

Possibly... Obviously you should test it out with a sacrificial folder before hand.

Edited by X-13
Needs recursion
Posted

But would that search all the subfolders of that share to delete them?

 

I am sure it is something simple, it is just my brain it totally fried. Too many days of data transfers.

Posted
But would that search all the subfolders of that share to delete them?

 

I am sure it is something simple, it is just my brain it totally fried. Too many days of data transfers.

 

I revised if for a FOR loop.

 

May need to be FOR /R.

 

 

However, I am far too hot at the moment to work it out...

Posted
I know how you feel, I have actually started to work directly on the servers instead of using RDP so that I have an excuse to cool down :-)
Posted
couldnt you just search for file names starting ~$ in explorer wait for it to finish then just select all delete?
Posted

Just to let you know, this has solved the problem :-) it was exactly what I needed. I have been out for a Pizza now and some shopping (brought a copy of The Way Things Work - New Edition :-) ) and seem to be back on game.

 

I purely was not thinking earlier

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...