Here's the script in English:
AutoIt expand collapse popup
#Region EzSkinConvert
; #INDEX# =======================================================================================================================
; Title .........: ProtectFolder.au3
; AutoIt Version.: 3.3.0.0
; Language.......: Portuguese (Brazil)
; --------------------------------------------------- EzSkin_PreProcessor.au3 ----------------------------------------------------
; Version .......: 2.08.1809.2600
; Modified.......: By EzSkinConvert.au3
; Remarks .......: Code re-written by EzSkinConvert, created by JScript. Based on the: EzSkin_1-2-3, ver 1.0.2 - Feb 17, 2007
; Credits .......: Original EzSkin.au3 version (1.0.2 - Feb 17, 2007) is made by Valuater.
; For personal use only, All Rights Reserved. Thank you big_daddy, Joscpe and SmOke_N.
; <a href='http://www.autoitscript.com/forum/index.php?showtopic=41319&view=findpost&p=307380' class='bbc_url' title=''>http://www.autoitscript.com/forum/index.php?showtopic=41319&view=findpost&p=307380</a>
; ===============================================================================================================================
#include "EzSkin_Lite(ProtectFolder).au3"
#EndRegion EzSkinConvert
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.2.12.0
Author: JScript (Joăo Carlos FROM BRAZIL)
dvi-suporte@hotmail.com / www.dvi-informatica.blogspot.com
Script Function: ProtectFolder
#ce ----------------------------------------------------------------------------
#NoTrayIcon
;#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=.\Resources\Icons\Icon.ico
#AutoIt3Wrapper_Outfile=ProtectFolder.exe ;Target exe/a3x filename.
#AutoIt3Wrapper_Outfile_Type=exe ;a3x=small AutoIt3 file; exe=Standalone executable (Default)
#AutoIt3Wrapper_Compression=0 ;Compression parameter 0-4 0=Low 2=normal 4=High. Default=2
#AutoIt3Wrapper_UseUpx=n ;(Y/N) Compress output program. Default=Y
#AutoIt3Wrapper_UseAnsi=y ;(Y/N) Use Ansi versions for AutoIt3a or AUT2EXEa. Default=N
;** Target program Resource info
#AutoIt3Wrapper_Res_Comment=Protege uma pasta ( diretório) contra Leitura/Gravaçăo năo autorizada.
#AutoIt3Wrapper_Res_Description=Protege uma pasta ( diretório) contra Leitura/Gravaçăo năo autorizada.
#AutoIt3Wrapper_Res_Fileversion=2.06.2309.2600
#AutoIt3Wrapper_Res_SaveSource=n
;#AutoIt3Wrapper_Res_Language=1046
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=n ;(Y/N/P) AutoIncrement FileVersion After Aut2EXE is finished. default=N
; P=Prompt, Will ask at Compilation time if you want to increase the version number.
#AutoIt3Wrapper_Res_LegalCopyright=© JScript - 2009 ( FROM BRAZIL) ;Copyright field
; free form resource fields ... max 15
; you can use the following variables:
; %AutoItVer% which will be replaced with the version of AutoIt3
; %date% = PC date in short date format
; %longdate% = PC date in long date format
; %time% = PC timeformat
; eg: #AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer%
://////= __ =
://////= __ =-/.
://////= __ =.=
://////= __ =-/.= rights reserved.
://////= __ =
://////= __ =.=
; DigitalProductID is StringToBinary(@ScriptName)
://////= __ =
;Add extra ICO files to the resources which can be used with TraySetIcon(@ScriptFullPath, 3) etc
; list of filename of the Ico files to be added, First one will have number 3, then 4 ..etc
; Filename of ICO to be added.
#AutoIt3Wrapper_Res_Icon_Add=.\Resources\Icons\Icon.ico
; Filename[,Section [,ResName]] to be added.
;#AutoIt3Wrapper_Res_File_Add=
;
; RUN BEFORE AND AFTER definitions
; The following directives can contain:
; %in% , %out%, %icon% which will be replaced by the fullpath\filename.
; %scriptdir% same as @ScriptDir and %scriptfile% = filename without extension.
; %fileversion% is the information from the #AutoIt3Wrapper_Res_Fileversion directive
; %scitedir% will be replaced by the SciTE program directory
; %autoitdir% will be replaced by the AutoIt3 program directory
#AutoIt3Wrapper_Run_Before= ;process to run before compilation - you can have multiple records that will be processed in sequence
;process to run After compilation - you can have multiple records that will be processed in sequence
;#AutoIt3Wrapper_Run_After=
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <String.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
Opt ( "ExpandEnvStrings" , 1 )
Opt ( "ExpandVarStrings" , 0 )
; Only for compiled
If Not @Compiled Then
; _EzSkinMsgBox( flag, "title", "text" [, timeout [, hwnd [, "ownButtons" [, left [, top [, filename [, resname _
; [, restype [, allwaysActive ]]]]]] )
; If Left or/and Top = -2 then active Random Position
_ EzSkinMsgBox
( 262160 , "Error" , "Only for compiled script!" )
Exit
EndIf
; Set variables
; ------------------------------------------------------------------------------
Local $sFolder = FileGetShortName ( StringReplace ( $CmdLineRaw , '"' , "" ) )
Local $sSendTo = @UserProfileDir & "\SendTo\ProtectFolder.lnk"
Local $sScriptPath = FileGetShortName ( @ScriptFullPath )
Local $sTargetPath , $sAttrib
If $CmdLineRaw = "/FileCreateShortcut" Then
FileCreateShortcut ( $sScriptPath , $sSendTo )
Exit
EndIf
; Check...
If $sFolder = "" Then
$sTargetPath = FileGetShortcut ( $sSendTo )
If @error Then
FileCreateShortcut ( $sScriptPath , $sSendTo )
ElseIf $sTargetPath [ 0 ] <> $sScriptPath Then
FileCreateShortcut ( $sScriptPath , $sSendTo )
EndIf
$sFolder = FileSelectFolder ( "Choose a folder to Lock or Unlock..." , "" , 7 , @ScriptDir )
Else
$sAttrib = FileGetAttrib ( $sFolder )
If Not StringInStr ( $sAttrib , "D" ) Then
If IsDeclared ( "sEZS_VERSION" ) Then
_ EzSkinMsgBox
( 262160 , "Error!" , "The ProtectFolder does not work on files, only folders!" , - 1 , "" , "" , - 1 , - 1 , True )
Else
_ EzSkinMsgBox
( 262160 , "Error!" , "The ProtectFolder does not work on files, only folders! " )
EndIf
Exit
EndIf
EndIf
If $sFolder = "" Then Exit
_ ProtectFolder
( $sFolder )
; #FUNCTION# ====================================================================================================================
; Name...........: _ProtectFolder
; Description ...: It protects a folder against no authorized reading/recording.
; Syntax.........: _ProtectFolder( "Path" )
; Parameters ....: Path - Full Path of folder to block/unblock
; Return values .: Success - Returns a friendly message and exit.
; Failure - Returns a friendly message and exit.
; Author ........: jscript
; Modified.......:
; Remarks .......: Only tested in Microsoft Windows XP SP2.
; Related .......:
; Link ..........;
; Example .......; _ProtectFolder( @MyDocumentsDir )
; ===============================================================================================================================
Func _ ProtectFolder
( $sPath )
$sPath = FileGetLongName ( $sPath )
; Set variables
Local $sOldCLSID = ""
Local $sCLSID = "{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}" ; Windows security (2K, XP and above... Seven !?!?)
Local $sDesktopINI = $sPath & "\Desktop.ini"
Local $sPassword = "" , $sCheckPass = ""
Local $sSecurityKey = ""
Local $iDropEffect = 0
Local $sOldAttrib = ""
Local $FileExisted = 0
; Verify if Desktop.ini exists...
If FileExists ( $sDesktopINI ) Then
$sOldCLSID = IniRead ( $sDesktopINI , ".ShellClassInfo" , "CLSID" , "" )
$sSecurityKey = IniRead ( $sDesktopINI , "Security" , "Key" , "" )
$FileExisted = 1
EndIf
; Make the folder a system folder...
$sOldAttrib = FileGetAttrib ( $sPath )
FileSetAttrib ( $sPath , "+S" )
If $sSecurityKey = "" Then
While 1
;_EzSkinInputBox( "title", "Prompt" [, "Default" [, "password char" [, Width, Height [, Left, Top [, timeOut _
; [, hwnd [, "ownButtons" [, allwaysActive ]]]]]]]] )
; If Left or/and Top = -2 then active Random Position
; Version 2.6 - Limitations in this version: Only the character "*" is used for masking.
$sPassword = _ EzSkinInputBox
( "Lock" , "Enter password to lock the folder:" & @CRLF & @CRLF & $sPath , "" , "*" )
If @error Or $sPassword = "" Then Exit
$sCheckPass = _ EzSkinInputBox
( "Lock" , @CRLF & @CRLF & "Enter password again to confirm:" , "" , "*" )
If @error Or $sCheckPass = "" Then Exit
If $sPassword <> $sCheckPass Then
If IsDeclared ( "sEZS_VERSION" ) Then
If _ EzSkinMsgBox
( 262197 , "Error!" , "The password you entered does not match!" , - 1 , "" , "" , - 1 , - 1 , True ) = 4 Then ContinueLoop
Else
If _ EzSkinMsgBox
( 262197 , "Error!" , "The password you entered does not match!" ) = 4 Then ContinueLoop
EndIf
Exit
EndIf
ExitLoop
WEnd
IniWrite ( $sDesktopINI , ".ShellClassInfo" , "CLSID" , $sCLSID )
If $sOldCLSID <> "" Then IniWrite ( $sDesktopINI , "Security" , "OldCLSID" , $sOldCLSID )
$iDropEffect = IniRead ( $sDesktopINI , ".ShellClassInfo" , "DefaultDropEffect" , 0 )
If $iDropEffect > 0 Then IniWrite ( $sDesktopINI , "Security" , "DefaultDropEffect" , $iDropEffect )
IniWrite ( $sDesktopINI , ".ShellClassInfo" , "DefaultDropEffect" , 4 )
IniWrite ( $sDesktopINI , "Security" , "Key" , _StringToHex ( $sPassword ) )
IniWrite ( $sDesktopINI , "Security" , "FileExisted" , $FileExisted )
_ EzSkinMsgBox
( 262208 , "Protect Folder" , "The folder " & $sPath & ", was successfully locked!" , - 1 , "" , "" , - 1 , - 1 , True )
Else
While 1
$sPassword = _ EzSkinInputBox
( "Unlock" , "Enter password to unlock the folder: " & @CRLF & @CRLF & $sPath , "" , "*" )
If @error Then Exit
If _StringToHex ( $sPassword ) <> $sSecurityKey Then
If IsDeclared ( "sEZS_VERSION" ) Then
If _ EzSkinMsgBox
( 262165 , "Forgot your password?" , "Enter the password again." & @CRLF & "Make sure to use uppercase and lowercase letters." , - 1 , "" , "" , - 1 , - 1 , True ) = 4 Then ContinueLoop
Else
If _ EzSkinMsgBox
( 262165 , "Forgot your password?" , "Enter the password again." & @CRLF & "Make sure to use uppercase and lowercase letters." ) = 4 Then ContinueLoop
EndIf
Exit
EndIf
ExitLoop
WEnd
$sOldCLSID = IniRead ( $sDesktopINI , "Security" , "OldCLSID" , "" )
If $sOldCLSID = "" Then
IniDelete ( $sDesktopINI , ".ShellClassInfo" , "CLSID" )
Else
IniWrite ( $sDesktopINI , ".ShellClassInfo" , "CLSID" , $sOldCLSID )
EndIf
$iDropEffect = IniRead ( $sDesktopINI , "Security" , "DefaultDropEffect" , 0 )
If $iDropEffect = 0 Then
IniDelete ( $sDesktopINI , ".ShellClassInfo" , "DefaultDropEffect" )
Else
IniWrite ( $sDesktopINI , ".ShellClassInfo" , "DefaultDropEffect" , $iDropEffect )
EndIf
If IniRead ( $sDesktopINI , "Security" , "FileExisted" , 1 ) = 0 Then
FileDelete ( $sDesktopINI )
Else
IniDelete ( $sDesktopINI , "Security" )
EndIf
If IsDeclared ( "sEZS_VERSION" ) Then
_ EzSkinMsgBox
( 262208 , "Protect Folder" , "The folder " & $sPath & ", was successfully unlocked!" , - 1 , "" , "" , - 1 , - 1 , True )
Else
_ EzSkinMsgBox
( 262208 , "Protect Folder" , "The folder " & $sPath & ", was successfully unlocked!" )
EndIf
EndIf
; Mark it as hidden and system to ensure that it is hidden from normal users...
FileSetAttrib ( $sDesktopINI , "+SH" )
; Reset the attributs folder...
FileSetAttrib ( $sPath , $sOldAttrib )
Send ( "{F5}" )
EndFunc ;==>_ProtectFolder
Nice!!! Thanks...
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}]
@="Windows Security"
"LocalizedString"="@explorer.exe,-7022"
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,34,00,38,\
00,00,00
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\InProcServer32]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
64,00,6f,00,63,00,76,00,77,00,2e,00,64,00,6c,00,6c,00,00,00
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\Instance]
"CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\Instance\InitPropertyBag]
"CLSID"="{13709620-C279-11CE-A49E-444553540000}"
"command"="@shell32.dll,-12707"
"method"="WindowsSecurity"
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\shellex]
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\shellex\ContextMenuHandlers]
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\shellex\ContextMenuHandlers\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}]
@=""
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\shellex\MayChangeDefaultMenu]
@=""
[HKEY_CLASSES_ROOT\CLSID\{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\ShellFolder]
"Attributes"=dword:00000000