Deleting a locked or protected folder via the opening of a readme file


  1. ddb
    Posts : 15
    Windows 10 Pro 64 Bit
       #1

    Deleting a locked or protected folder via the opening of a readme file


    I have a folder which is locked via "Lock-A-FoLdeR" program.
    I would like to create a readme file (doc or txt) that when opened would unlock the folder and then permanently delete the folder and its contents.
    This is a folder I want to be deleted when my surviving spouse begins pouring through the folder I have created called "In The Event of My Death". Upon going through this folder a readme file would be opened and thus deletion of the said folder would occur.
    Not sure this is the correct forum to use, so any help would be greatly appreciated.
      My Computer

  2. dalchina's Avatar
    Posts : 30,035
    Win 10 Pro (1903)
       #2

    I would suggest you look into using Autohotkey (free) - a scripting language from the trivial to complete small programs, defining hotkeys to manipulating processes and existing windows.

    Perhaps something like this:
    The script continually runs, monitoring one or more files in that folder.
    If the file is opened, then the script deletes the locked folder.

    Note: this assumes deleting a folder locked by that program is a trivial matter.

    You'd probably only need about 5 or 6 lines.
    Two to define the loop.
    One to define a delay time in the loop
    One to define a conditional test on the state of the file(s)
    One to delete the folder

    Autohotkey has a brilliant and extensive help file with examples per instruction, and a supportive forum.

    You might also be able to monitor the state of the folder..
      My Computers


  3. ddb
    Posts : 15
    Windows 10 Pro 64 Bit
    Thread Starter
       #3

    Thank you so much. I will give this a go.
      My Computer

  4. dalchina's Avatar
    Posts : 30,035
    Win 10 Pro (1903)
       #4

    The script file is a simple text file, so you can test each individual line just by double clicking the text file (xxxxx.ahk).

    When run any errors are flagged per line.

    Can also compile the ahk file -> exe by rt click and Compile.

    So it's easy to play with.
      My Computers


  5. ddb
    Posts : 15
    Windows 10 Pro 64 Bit
    Thread Starter
       #5

    Hello dalchina,

    In my attempt to write a script I have run into an issue I do not know how to proceed past. It is explained as follows:
    I am attempting to run the program from a script but do not know how to get the script to complete unless I can insert syntax about the password it needs to run.
    In other words, what would be the script syntax in addition to the following?
    Testing is being done using CMD as follows:
    C:\Program Files (x86)\LocK-A-FoLdeR\lock-a-folder.exe /uk “G:\FakeFolder
    Doing this brings up the dialog asking for the password, but I want the script to run with the password already present in the script.
    Thus, it finishes with the desired result, in this case, unlocking G:\FakeFolder.
    FakeFolder is an actual empty folder on my G drive I created for testing the script.
    I have just now installed Autohotkey, but need to learn how to use.
    So just for now playing with script in the CMD to see how this is going to work.
      My Computer

  6. dalchina's Avatar
    Posts : 30,035
    Win 10 Pro (1903)
       #6

    CMD and Autohotkey are substantially different.

    I would have thought that rather than try to use and trigger the Lock... program, you would have simply aimed to delete the locked folder- depending I suppose on what this Lock... program has done to it.

    So you need first to decide by what general method you're going to delete the folder.

    Then as you have just installed Autohotkey, you need to start playing with a few simple examples, and find the sort of instructions you need from its syntax.

    I don't know anything about the Lock... program, so can't advise.

    I can say Autohotkey can send strings to a program, for example.
      My Computers


  7. ddb
    Posts : 15
    Windows 10 Pro 64 Bit
    Thread Starter
       #7

    Thanks. Now I will dive into learning Autohotkey, should be a blast.
    LocK-A-FoLdeR program requires a password to be typed in to open the dialog containing the list of locked folders. The required password is typed into the first popup upon running the executable.
    Looking at Autohotkey's Alphabetical Command and Function Index I see a large number of examples.
    Looks like InputBox is where I would input a password.
    Again thanks for your help.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:03.
Find Us




Windows 10 Forums