unuro Posted August 15, 2012 Share Posted August 15, 2012 (edited) Hello! So That I Could Do is all about myself in the software like this, Expect Improvements from you, Who Wants to Help Develop this script. Thank you! I'm sorry for the problems of writing in English, I'm from Romania! expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <File.au3> #include <Crypt.au3> #NoTrayIcon $Form1 = GUICreate("Locked Software", 240, 52, -1, -1) $Button1 = GUICtrlCreateButton("Lock All Files", 8, 16, 99, 25) $Button2 = GUICtrlCreateButton("Unlock All Files", 120, 16, 107, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $Folder = FileSelectFolder("Choose a folder.", "", 1, @DesktopDir,$Form1) If Not @error Then $List1 = _FileListToArray($Folder, "*", 1) For $nr = 1 To $List1[0] ProcessClose($List1[$nr]) Sleep(1) _Crypt_EncryptFile($Folder&""&$List1[$nr],$Folder&""&$List1[$nr]&".crypted","unu",$CALG_DES) Sleep(1) FileDelete($Folder&""&$List1[$nr]) Next MsgBox(64,"Info","Finishied Crypt!") ElseIf @error = 1 Then ExitLoop($Folder) Else MsgBox(16,"Error",@error) EndIf Case $Button2 $Folder = FileSelectFolder("Choose a folder.", "", 1, @DesktopDir,$Form1) If Not @error Then $List1 = _FileListToArray($Folder, "*.crypted", 1) For $nr = 1 To $List1[0] $String = StringTrimRight($Folder&""&$List1[$nr], 8) _Crypt_DecryptFile($Folder&""&$List1[$nr],$String,"unu",$CALG_DES) Sleep(1) FileDelete($Folder&""&$List1[$nr]) Next MsgBox(64,"Info","Finishied Decrypt!") ElseIf @error = 1 Then ExitLoop($Folder) Else MsgBox(16,"Error",@error) EndIf EndSwitch WEnd Edited August 15, 2012 by unuro Link to comment Share on other sites More sharing options...
Mechaflash Posted August 15, 2012 Share Posted August 15, 2012 Looks and sounds like crap... Looks like crap cause you didn't use AutoIt tags... Sounds like crap cause you didn't explain what it does. Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
unuro Posted August 15, 2012 Author Share Posted August 15, 2012 What is 'what' ? This simple program may be able to block a list of files of any type in a specific folder... Link to comment Share on other sites More sharing options...
wraithdu Posted August 15, 2012 Share Posted August 15, 2012 This is not a build-my-script forum. Examples are meant for full working scripts or libraries. This belongs in General at best, certainly not here. Link to comment Share on other sites More sharing options...
unuro Posted August 15, 2012 Author Share Posted August 15, 2012 (edited) ok, sorry for that... please move this topic to 'General Help and Support "Thank you!UPDATEI need this script as well done ....I wanted your help on some improvements, if possible ...such improvements, to remove the ". Crypted" and encrypt the same name. Edited August 16, 2012 by unuro Link to comment Share on other sites More sharing options...
shai Posted August 16, 2012 Share Posted August 16, 2012 (edited) if the folder you select is empty the script is crash. this is a fixed code: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <File.au3> #include <Crypt.au3> #NoTrayIcon $Form1 = GUICreate("Locked Software", 240, 52, -1, -1) $Button1 = GUICtrlCreateButton("Lock All Files", 8, 16, 99, 25) $Button2 = GUICtrlCreateButton("Unlock All Files", 120, 16, 107, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $Folder = FileSelectFolder("Choose a folder.", "", 1, @DesktopDir,$Form1) If Not @error Then $List1 = _FileListToArray($Folder, "*", 1) If Not IsArray($List1) Then MsgBox(0,"error", "the selected folder is empty") Else For $nr = 1 To $List1[0] ProcessClose($List1[$nr]) Sleep(1) _Crypt_EncryptFile($Folder&""&$List1[$nr],$Folder&""&$List1[$nr]&".crypted","unu",$CALG_DES) Sleep(1) FileDelete($Folder&""&$List1[$nr]) Next MsgBox(64,"Info","Finishied Crypt!") EndIf ElseIf @error = 1 Then ExitLoop($Folder) Else MsgBox(16,"Error",@error) EndIf Case $Button2 $Folder = FileSelectFolder("Choose a folder.", "", 1, @DesktopDir,$Form1) If Not @error Then $List1 = _FileListToArray($Folder, "*.crypted", 1) If Not IsArray($List1) Then MsgBox(0,"error", "the selected folder is empty") Else For $nr = 1 To $List1[0] $String = StringTrimRight($Folder&""&$List1[$nr], 8) _Crypt_DecryptFile($Folder&""&$List1[$nr],$String,"unu",$CALG_DES) Sleep(1) FileDelete($Folder&""&$List1[$nr]) Next MsgBox(64,"Info","Finishied Decrypt!") EndIf ElseIf @error = 1 Then ExitLoop($Folder) Else MsgBox(16,"Error",@error) EndIf EndSwitch WEnd Edited August 16, 2012 by shai Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now