Goodbye everybody, I got tired of this system adopted here!
Active Members
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.; http://www.autoitscript.com/forum/index.php?showtopic=41319&view=findpost&p=307380; ===============================================================================================================================#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=(C) 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 compiledIfNot@CompiledThen; _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!")ExitEndIf; Set variables; ------------------------------------------------------------------------------Local$sFolder=FileGetShortName(StringReplace($CmdLineRaw,'"',""))Local$sSendTo=@UserProfileDir&"\SendTo\ProtectFolder.lnk"Local$sScriptPath=FileGetShortName(@ScriptFullPath)Local$sTargetPath,$sAttribIf$CmdLineRaw="/FileCreateShortcut"ThenFileCreateShortcut($sScriptPath,$sSendTo)ExitEndIf; Check...If$sFolder=""Then$sTargetPath=FileGetShortcut($sSendTo)If@errorThenFileCreateShortcut($sScriptPath,$sSendTo)ElseIf$sTargetPath[0]<>$sScriptPathThenFileCreateShortcut($sScriptPath,$sSendTo)EndIf$sFolder=FileSelectFolder("Choose a folder to Lock or Unlock...","",7,@ScriptDir)Else$sAttrib=FileGetAttrib($sFolder)IfNotStringInStr($sAttrib,"D")ThenIfIsDeclared("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! ")EndIfExitEndIfEndIfIf$sFolder=""ThenExit_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 variablesLocal$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=0Local$sOldAttrib=""Local$FileExisted=0; Verify if Desktop.ini exists...IfFileExists($sDesktopINI)Then$sOldCLSID=IniRead($sDesktopINI,".ShellClassInfo","CLSID","")$sSecurityKey=IniRead($sDesktopINI,"Security","Key","")$FileExisted=1EndIf; Make the folder a system folder...$sOldAttrib=FileGetAttrib($sPath)FileSetAttrib($sPath,"+S")If$sSecurityKey=""ThenWhile1;_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@errorOr$sPassword=""ThenExit$sCheckPass=_EzSkinInputBox("Lock",@CRLF&@CRLF&"Enter password again to confirm:","","*")If@errorOr$sCheckPass=""ThenExitIf$sPassword<>$sCheckPassThenIfIsDeclared("sEZS_VERSION")ThenIf_EzSkinMsgBox(262197,"Error!","The password you entered does not match!",-1,"","",-1,-1,True)=4ThenContinueLoopElseIf_EzSkinMsgBox(262197,"Error!","The password you entered does not match!")=4ThenContinueLoopEndIfExitEndIfExitLoopWEndIniWrite($sDesktopINI,".ShellClassInfo","CLSID",$sCLSID)If$sOldCLSID<>""ThenIniWrite($sDesktopINI,"Security","OldCLSID",$sOldCLSID)$iDropEffect=IniRead($sDesktopINI,".ShellClassInfo","DefaultDropEffect",0)If$iDropEffect>0ThenIniWrite($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)ElseWhile1$sPassword=_EzSkinInputBox("Unlock","Enter password to unlock the folder: "&@CRLF&@CRLF&$sPath,"","*")If@errorThenExitIf_StringToHex($sPassword)<>$sSecurityKeyThenIfIsDeclared("sEZS_VERSION")ThenIf_EzSkinMsgBox(262165,"Forgot your password?","Enter the password again."&@CRLF&"Make sure to use uppercase and lowercase letters.",-1,"","",-1,-1,True)=4ThenContinueLoopElseIf_EzSkinMsgBox(262165,"Forgot your password?","Enter the password again."&@CRLF&"Make sure to use uppercase and lowercase letters.")=4ThenContinueLoopEndIfExitEndIfExitLoopWEnd$sOldCLSID=IniRead($sDesktopINI,"Security","OldCLSID","")If$sOldCLSID=""ThenIniDelete($sDesktopINI,".ShellClassInfo","CLSID")ElseIniWrite($sDesktopINI,".ShellClassInfo","CLSID",$sOldCLSID)EndIf$iDropEffect=IniRead($sDesktopINI,"Security","DefaultDropEffect",0)If$iDropEffect=0ThenIniDelete($sDesktopINI,".ShellClassInfo","DefaultDropEffect")ElseIniWrite($sDesktopINI,".ShellClassInfo","DefaultDropEffect",$iDropEffect)EndIfIfIniRead($sDesktopINI,"Security","FileExisted",1)=0ThenFileDelete($sDesktopINI)ElseIniDelete($sDesktopINI,"Security")EndIfIfIsDeclared("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!")EndIfEndIf; 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:
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..
_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.
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.
_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.