Jump to content



Photo

ProtectFolder


  • Please log in to reply
21 replies to this topic

#1 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 15 September 2009 - 10:21 PM

Hello,
I wrote this script to protect my personal folders, but I only tested in XP SP1, SP2 and Vista.
Help me to improve it, testing in other "OS".

Updated in 10/05/2012, v3.05
Download:
Attached File  ProtectFolder_v3.05.1012.2600_10-05-2012.zip   12.93KB   197 downloads
Previous 530 downloads...

ProtectFolder1.jpg ProtectFolder2.jpg ProtectFolder3.jpg

Edited by JScript, 10 May 2012 - 12:40 PM.

http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       








#2 dantay9

dantay9

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 834 posts

Posted 15 September 2009 - 10:57 PM

Works really nicely. I like how the icon for the locked folders change.

An English translation would be nice.

Edited by dantay9, 15 September 2009 - 11:00 PM.

"Failure is not an option -- it comes packaged with Windows" Gecko Web Browser, Yahtzee!, Toolbar Launcher (like RocketDock)Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI Triangle Solver, TCP File Transfer, Valuater's Autoit WrappersOOP In AutoItUsing Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com

#3 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 15 September 2009 - 11:03 PM

Works really nicely. I like how the icon for the locked folders change.

An English translation would be nice.

Yes, do you translate it for me? Collaborate with me, I am without time... :D
Which Windows do you use?

Edited by jscript, 15 September 2009 - 11:04 PM.

http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       


#4 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 15 September 2009 - 11:53 PM

I can still access the protected folder.
Probably because I am using XP Home SP3.

#5 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 16 September 2009 - 12:01 AM

I can still access the protected folder.
Probably because I am using XP Home SP3.

We will try to solve this...
but don't you get to write anything, only to read?

I'm not sure if the key: {2559a1f2-21d7-11d4-bdaf-00c04f60b9f0} it is present in all the versions of Windows...

Edited by jscript, 16 September 2009 - 12:04 AM.

http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       


#6 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 16 September 2009 - 12:13 AM

Here's the script in English:
AutoIt         
#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


#7 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 16 September 2009 - 12:14 AM

Can you explain what that key is suppose to do?

#8 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 16 September 2009 - 12:26 AM

Here's the script in English:

AutoIt         
#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...

The key: {2559a1f2-21d7-11d4-bdaf-00c04f60b9f0} is related to "Windows Security", see the code exported by Regedit:
Plain Text         
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

http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       


#9 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 16 September 2009 - 12:43 AM

Try this instead: {21EC2020-3AEA-1069-A2DD-08002B30309D}. This will actually turn your folder into a "shortcut to control panel".

#10 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 16 September 2009 - 01:02 AM

Try this instead: {21EC2020-3AEA-1069-A2DD-08002B30309D}. This will actually turn your folder into a "shortcut to control panel".

Yes, But the icon of the padlock disappears :D
Appears the icon of the control panel...
However, it works well!
http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       


#11 FireFox

FireFox

    What is dead may never die

  • MVPs
  • 3,511 posts

Posted 16 September 2009 - 12:06 PM

I have created a script to protect data too (a few months ago), it has many functions and work on all win OS.
I will create a new topic to share it :D

Cheers, FireFox.

Edited by FireFox, 16 September 2009 - 12:08 PM.

OS : Win XP SP3 / Win 7 SP1 / Win 8 | Autoit version: latest stable / beta

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : IP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

Updated 22 April, 2013 - If you find dead links please send me a PM, do not post in the topics !

#12 Belini

Belini

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 08 May 2012 - 02:11 PM

Sorry for resurrecting the topic more precise protect folder on Linux too, is possible using autoit?

Edited by Belini, 08 May 2012 - 02:13 PM.


#13 knightz93

knightz93

    Seeker

  • Active Members
  • 23 posts

Posted 08 May 2012 - 02:35 PM

Autoit actually create for Windows OS only, and i dont think, it will work on linux because linux use other executable file format.. all applicaton create by using Windows OS can't using in linux OS... You need to research more about different between other OS and Windows.. if you want to create application in linux, try to study in java, c or c++...download eclipse in linux because this application good for beginner in linux os.. ;).. i dont think so..


Edit :

Different animal, different part of body, different Os, different programming instruction..

Edited by knightz93, 08 May 2012 - 02:41 PM.

I will do my best in this forum my code : WindowsSwitcher3d()

#14 Belini

Belini

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 09 May 2012 - 06:43 PM

The Windows did not lock folders in Linux, then the autoit also fails

Edited by Belini, 09 May 2012 - 07:59 PM.


#15 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 7,053 posts

Posted 09 May 2012 - 06:56 PM

Can your version of Windows access the Linux file system at all?

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#16 Belini

Belini

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 09 May 2012 - 07:58 PM

Linux can access files from Windows partitions and more Windows can not access anything Linux.

Files on Linux are more protected windows otherwise not happen.

Edited by Belini, 09 May 2012 - 07:59 PM.


#17 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 7,053 posts

Posted 09 May 2012 - 08:04 PM

My point was, if your Windows can't see/access the Linux partitions, then AutoIt isn't going to magically make them appear.

As to whether or not Linux files are more protected, who cares, this is an AutoIt forum, and AutoIt doesn't work on Linux (without using WINE that is). If you want to use Linux use it, but don't expect a Windows only program to be able to be used with it.
  • JohnOne likes this

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#18 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 10 May 2012 - 12:31 AM

;)
http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       


#19 Belini

Belini

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 10 May 2012 - 12:06 PM

@BrewManNH for me it is:
Posted Image

Edited by Belini, 10 May 2012 - 12:46 PM.


#20 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 10 May 2012 - 03:08 PM

I'll be watching you two, here is no place for such insults!! 
João Carlos.

Edited by JScript, 10 May 2012 - 03:10 PM.

http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users