+ Post New Thread
Results 1 to 12 of 12
Windows Thread, Problem deleting lots of folders within folders in Technical; Hi, I run a script every night which deletes .exe files from student home filders. Some students have figured out ...
  1. #1

    Join Date
    Jul 2007
    Location
    Ripon
    Posts
    5
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Problem deleting lots of folders within folders

    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.

  2. #2
    ICT_GUY's Avatar
    Join Date
    Feb 2007
    Location
    Weymouth
    Posts
    2,261
    Thank Post
    646
    Thanked 283 Times in 204 Posts
    Rep Power
    103
    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.

  3. #3
    bizzel's Avatar
    Join Date
    Jul 2007
    Location
    Cambridge
    Posts
    654
    Thank Post
    102
    Thanked 204 Times in 72 Posts
    Rep Power
    50
    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.
    Last edited by bizzel; 13th March 2008 at 10:24 AM.

  4. #4

    Join Date
    Jul 2007
    Location
    Ripon
    Posts
    5
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

  5. #5
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,185
    Thank Post
    392
    Thanked 278 Times in 239 Posts
    Rep Power
    74
    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 ;-)

  6. #6
    harrno's Avatar
    Join Date
    Apr 2007
    Location
    Stansted Mountfitchet
    Posts
    13
    Thank Post
    2
    Thanked 1 Time in 1 Post
    Rep Power
    0
    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.

  7. #7

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    64
    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\pictu res\ 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"

  8. #8

    Join Date
    Jul 2007
    Location
    Ripon
    Posts
    5
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks cookie monster, got the offending folders deleted now.

  9. #9
    joe90bass's Avatar
    Join Date
    Oct 2007
    Location
    S Wales
    Posts
    1,345
    Thank Post
    316
    Thanked 106 Times in 95 Posts
    Rep Power
    50
    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?

  10. #10

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    64
    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.

  11. #11
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,185
    Thank Post
    392
    Thanked 278 Times in 239 Posts
    Rep Power
    74
    @ 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.

  12. #12
    Busybub's Avatar
    Join Date
    Feb 2007
    Posts
    384
    Thank Post
    44
    Thanked 39 Times in 37 Posts
    Rep Power
    21
    Late to the party as usual, but I use this:

    ftp://sherwood.lh.umu.se/public/CobDeleter.exe

SHARE:
+ Post New Thread

Similar Threads

  1. Sharing Folders
    By faza in forum Wireless Networks
    Replies: 9
    Last Post: 3rd March 2008, 05:33 PM
  2. Consolidating Folders
    By Jamie_a in forum Windows
    Replies: 1
    Last Post: 19th December 2007, 10:57 AM
  3. Quotas on Folders
    By Grommit in forum Windows
    Replies: 12
    Last Post: 22nd January 2007, 06:29 PM
  4. uncompressing folders
    By ranj in forum Windows
    Replies: 4
    Last Post: 9th May 2006, 02:39 PM
  5. Disappearing Folders
    By secman in forum Windows
    Replies: 9
    Last Post: 2nd March 2006, 04:34 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •