+ Post New Thread
Results 1 to 3 of 3
Office Software Thread, Walk a directory tree, check if docs are password protected, log ones that are? in Technical; I need to walk a series of directory trees, look at each file and log whether it's password-protected or not. ...
  1. #1


    Join Date
    Dec 2005
    Location
    In the server room, with the lead pipe.
    Posts
    4,677
    Thank Post
    279
    Thanked 782 Times in 609 Posts
    Rep Power
    224

    Walk a directory tree, check if docs are password protected, log ones that are?

    I need to walk a series of directory trees, look at each file and log whether it's password-protected or not. For the .doc format, I can just point the unix "file" command at the trees and grep on "Security: 1", but that doesn't work for .docx, which just shows up as an archive.

    I've found some vb that works by logging an error on bad passwords, but it's a horrible kludge and not reliable. I've also found lots of shady freeware/payware.

    Anyone found (or paid for) something that works well?
    Last edited by pete; 31st March 2010 at 01:59 PM.

  2. #2

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    Can't find anything :-(

    There's a property - Document.HasPassword - which will tell you if the document has a password set but it only works on a document which is already open.

    I know it's kludgy to just try and open the file and see if it fails but I can't see why this shouldn't be fairly robust - Skipping Password-Protected Documents in a Batch Process is an example of the kind of thing you can do.

  3. Thanks to srochford from:

    pete (31st March 2010)

  4. #3


    Join Date
    Dec 2005
    Location
    In the server room, with the lead pipe.
    Posts
    4,677
    Thank Post
    279
    Thanked 782 Times in 609 Posts
    Rep Power
    224
    Heh, that's the code I found

SHARE:
+ Post New Thread

Similar Threads

  1. Password protected print queue
    By meastaugh1 in forum How do you do....it?
    Replies: 5
    Last Post: 11th June 2009, 11:51 AM
  2. Move or copy a large directory tree
    By leco in forum How do you do....it?
    Replies: 7
    Last Post: 13th April 2009, 01:40 PM
  3. Password Protected Hard Drive
    By StewartKnight in forum Hardware
    Replies: 19
    Last Post: 6th November 2007, 10:51 AM

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
  •