sradams1977 Posted March 13, 2008 Posted March 13, 2008 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.
ICT_GUY Posted March 13, 2008 Posted March 13, 2008 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.
bizzel Posted March 13, 2008 Posted March 13, 2008 (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 March 13, 2008 by bizzel
sradams1977 Posted March 13, 2008 Author Posted March 13, 2008 Unfortunatly I have tried to delete their whole folder but I get the same "unable to delete" error because of the offending long file names.
cookie_monster Posted March 13, 2008 Posted March 13, 2008 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 ;-)
harrno Posted March 13, 2008 Posted March 13, 2008 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.
OutToLunch Posted March 13, 2008 Posted March 13, 2008 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"
sradams1977 Posted March 13, 2008 Author Posted March 13, 2008 Thanks cookie monster, got the offending folders deleted now.
joe90bass Posted March 13, 2008 Posted March 13, 2008 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?
OutToLunch Posted March 13, 2008 Posted March 13, 2008 For reference if anyone comes across this while searching, "You cannot delete a file or a folder on an NTFS file system volume" http://support.microsoft.com/kb/320081/en-us has a list of a variety of methods, including the UNC paths solution I mentioned and the drive mapping to subfolder.
cookie_monster Posted March 13, 2008 Posted March 13, 2008 @ sradams1977, glad it sorted it. We had this issue for a while once a few students realised they could do it fortunatly they left without passing it on.
Busybub Posted March 13, 2008 Posted March 13, 2008 Late to the party as usual, but I use this: ftp://sherwood.lh.umu.se/public/CobDeleter.exe
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now