Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:06:41+00:00 2026-06-18T01:06:41+00:00

As windows doesn’t provide password protection for individual folder, there are many third party

  • 0

As windows doesn’t provide password protection for individual folder, there are many third party software like ‘Folder Lock’ that does the job. I wanted to know the logic behind these kind of applications and found one code like this: ‘lock-a-folder’. This is an AutoIt script which I am not familiar with. However, I just want to know the logic used here.

These are the main functions of the script I am interested in:

Func Lock($slected)
  Local $Temp,$TempFile
  If @error or $slected = "" Then Return("Empty selection/Cancel Pressed")
  If Not FileExists($slected) Then
    MsgBox(0, $AppName, $slected & " " & Lang('doesntexist'), 0, $WIN1)
    Return('doesntexist')
  EndIf
  Local $l0ckd = RegRead("HKEY_CURRENT_USER\SOFTWARE\" & $AppName, "lockedfolders")
  _DebugOut('RegRead("HKEY_CURRENT_USER\SOFTWARE\" & $AppName, "lockedfolders") = ' & $l0ckd)

  If Not StringInStr($l0ckd, $slected & ".{90F8C996-7C70-4331-9D70-FB357D559FD5}|") = 0 Then
    MsgBox(0, $AppName, $slected & " " & Lang('alreadyinlist'), 0, $WIN1)
    Return('alreadyinlist')
  EndIf
  If $CmdLine[0] = 0 Then
    GUICtrlSetData($List1, "")
    GUICtrlSetData($List1, Lang('plzwait') & "....")
    GUISetState(@SW_DISABLE)
  EndIf
  _DebugOut($slected)
  If $CmdLine[0] = 0 Then GUISetState(@SW_ENABLE)
  If DirMove($slected, $slected & ".{90F8C996-7C70-4331-9D70-FB357D559FD5}") = 0 Then
  FileSetAttrib($slected, "-RSH")
  MsgBox(0, $AppName, $slected & " " & Lang('unable2lock'), 0, $WIN1)
  If $CmdLine[0] = 0 Then Readfolders()
    Return('unable2lock')
  EndIf
  $slected = $slected & ".{90F8C996-7C70-4331-9D70-FB357D559FD5}"
  FileSetAttrib($slected, "+RSH")
  $l0ckd &= $slected & "|"
  _DebugOut("$l0ckd &= $slected| = " & $l0ckd)
  $debug = RegWrite("HKEY_CURRENT_USER\SOFTWARE\" & $AppName, "lockedfolders", "REG_SZ", $l0ckd)
  _DebugOut('RegWrite("HKEY_CURRENT_USER\SOFTWARE\" & $AppName, "lockedfolders", "REG_SZ", $l0ckd) = ' & $debug)
  If $CmdLine[0] = 0 Then Readfolders()
  Return("Done")
EndFunc ;==>Lock


Func UnLock($slected)
  _DebugOut($slected)
  If $slected = "" Or @error Then
    MsgBox(0, $AppName, Lang('selectfirst'), 0, $WIN1)
    Return("Empty selection/Cancel Pressed")
  EndIf
  If $CmdLine[0] = 0 Then
    GUICtrlSetData($List1, "")
    GUICtrlSetData($List1, Lang('plzwait') & "....")
    GUISetState(@SW_DISABLE)
  EndIf
  Local $Temp = StringReplace($slected, ".{90F8C996-7C70-4331-9D70-FB357D559FD5}", "", 0, 2)
  _DebugOut("$Temp = " & $Temp)
  FileSetAttrib($slected, "-RSH")
  Local $Temp1
  $Temp1 = DirMove($slected, $Temp)
  If $CmdLine[0] = 0 Then GUISetState(@SW_ENABLE)
  If $Temp1 = 0 Then
    $Temp1 = DirMove($slected, $Temp & ".recovered")
  EndIf
  If $Temp1 = 0 Then

  MsgBox(0, $AppName, $slected & " " & Lang('unable2unlock'), 0, $WIN1)
  If $CmdLine[0] = 0 Then Readfolders()
    Return('unable2unlock')
  EndIf
  Local $l0ckd = RegRead("HKEY_CURRENT_USER\SOFTWARE\" & $AppName, "lockedfolders")
  _DebugOut('RegRead("HKEY_CURRENT_USER\SOFTWARE\" & $AppName, "lockedfolders") = ' & $l0ckd)
  $Temp = StringReplace($l0ckd, $slected & "|", "")
  _DebugOut('StringReplace($l0ckd, $slected & "|", "")' & " = " & $Temp)
  $debug = RegWrite("HKEY_CURRENT_USER\SOFTWARE\" & $AppName, "lockedfolders", "REG_SZ", $Temp)
  _DebugOut('RegWrite("HKEY_CURRENT_USER\SOFTWARE\" & $AppName, "lockedfolders", "REG_SZ", $l0ckd) = ' & $debug)
  If $CmdLine[0] = 0 Then Readfolders()
  Return("Done")
EndFunc ;==>UnLock

Can anybody please tell me the logic?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:06:42+00:00Added an answer on June 18, 2026 at 1:06 am

    The script creates registry entries like :

    HKCR\CLSID\{90F8C996-7C70-4331-9D70-FB357D559FD5}
    HKCR\CLSID\{90F8C996-7C70-4331-9D70-FB357D559FD5}\shell\open
    HKCR\CLSID\{90F8C996-7C70-4331-9D70-FB357D559FD5}\shell\explore
    HKCR\CLSID\{90F8C996-7C70-4331-9D70-FB357D559FD5}\shell\opennewwindow
    HKCR\CLSID\{90F8C996-7C70-4331-9D70-FB357D559FD5}\shell\opennewprocess
    

    and

    HKCU\SOFTWARE\$AppName\lockedfolders
    

    When locking a folder, it is renamed like FolderName.{90F8C996-7C70-4331-9D70-FB357D559FD5} and this name gets appended to the value of HKCU\SOFTWARE\$AppName\lockedfolders for future reference.

    When unlocking it just changes the folder back to its original name, removing the entry from the registry value.

    So it seems not secure at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to create a windows program that doesn't require any environmental dependencies (like
There is a blog post on Why Windows Mobile's X button doesn't close the
I'm trying to get this to work but apparently Windows doesn't like it. Once
I already found out with another question that Windows/MingW doesn't provide the nanosleep() and
The following query works on Oracle 10.2.0.1.0 on windows,but doesn't work on Oracle 10.2.0.2.0
I'm trying to compile beej's guide to network programming examples, but Windows XP doesn't
This code works for windows 7 but doesn't work for windows XP (outputs only
For some reason the following code doesn't work on Windows XP. new URL(file:// +
I have a printer that doesn't have the driver for my windows server 2008,
I have some older code that doesn't appear to work on 64bit Windows 7.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.