Jump to content

Recommended Posts

Posted

Hi, I run a script every night which deletes .exe files from student home filders. Some students have figured out that if they create lots of folders within folders they can't be deleted. e.g. one folder is named

 

"Y:\Data\students\0405\jbloggs\games\pictures\foot ball\year 9 work\games\ha ha aha ahahahahahahahahahaha aahahaah ah aha hahahahaha ha ah mwahwhahaha\games\ahhhahahahahahahahah ah ah a ah a ahaha ha ha haha ha ha ha ahh a ha\games" .

 

I have also tried the rmdir /s command but this also does not work. Has anyone ever come across a solution for this problem? Any help would be greatly appreciated. Thanks.

Posted
I would ban them from the computers for deliberately trying to get around measures implemented by the admin to insure the good running of the network. Couldn't possible argue otherwise in a case like that.
Posted (edited)

Delete all their files using explorer, that'd probably stop them doing it again. ;)

 

More seriously, the problem occurs when the path length is greater than 255 characters. Most software expects that to be the limit but NTFS is capable of a lot more. As a temporary workaround you could change your script to mount the offending folder as a drive and work from there. That may reduce the path length enough but it's not foolproof.

 

Another thing you can try is getting the short path name (that is, c:\progra~1 style names). I think DIR /X will show you them.

Edited by bizzel
Posted

The easiest way to get around this is to share a folder further down the structure so the path is less than 255 charecters.

 

e.g. share the games folder and then delete the folders below then remove the share and work your way back up the structure.

 

Y:\Data\students\0405\jbloggs\games\pictures\ foot ball\year 9 work\games\ha ha aha ahahahahahahahahahaha aahahaah ah aha hahahahaha ha ah mwahwhahaha\games\ahhhahahahahahahahah ah ah a ah a ahaha ha ha haha ha ha ha ahh a ha\games

 

Then i'd have a word with the student, maybe 2 words ;-)

Posted
You can sometimes get rid of the long filenames by renaming the directory above the one you want to delete. Not foolproof but works sometimes.
Posted

Have you tried using UNC paths in your script instead? I seem to remember this was how I got round problems in my cleanups before...

 

"Y:\Data\students\0405\jbloggs\games\pictures\ foot ball\year 9 work\games\ha ha aha ahahahahahahahahahaha aahahaah ah aha hahahahaha ha ah mwahwhahaha\games\ahhhahahahahahahahah ah ah a ah a ahaha ha ha haha ha ha ha ahh a ha\games"

 

becomes

 

"\\?\Y:\Data\students\0405\jbloggs\games\pictures\ foot ball\year 9 work\games\ha ha aha ahahahahahahahahahaha aahahaah ah aha hahahahaha ha ah mwahwhahaha\games\ahhhahahahahahahahah ah ah a ah a ahaha ha ha haha ha ha ha ahh a ha\games"

Posted
If funds allow in the future, Windows Storage Server will take care of this, you can block file types from being saved. I don't know if it's standard in 2008 server or only 2008 storage server?

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