AutoHotkey Community

It is currently May 26th, 2012, 10:30 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: August 10th, 2009, 8:37 am 
Offline

Joined: August 10th, 2009, 8:17 am
Posts: 12
Hey guys this app hides and password protects folder at "C:\lol" for this app to work you must have a folder called lol at the above location. hope you like it as its my first so yeah tell me what you thinks of it :)

Code:

;A message box
MsgBox, Please save your data and close all windows. Remove all external devices!
;Reading reg for hiddenfiles enabled or not
RegRead, OutputVar3, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL, CheckedValue
;reading output
s4 = %OutputVar3%

; 1 = hidden files enabled. 0 = hidden files disabled
if(s4 == 1)
{
    ;because hidden files are enabled, we're changing them to be disabled
    RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL, CheckedValue, 0
    MsgBox Registry is changed to 0.
    ;you have to restart your computer for this setting to be changed
    run shutdown -s -t 60 -c "YOU HAVE TOO SHUTDOWN YOUR COMPUTER FOR THIS TO TAKE AFFECT!"
}
else
{
    ;file called lol to be locked
    IfExist, C:\lol
    {
        InputBox, UserInput1, password, Enter Password, Please Enter Your PasswordPassword.,
        if ErrorLevel
        {
            MsgBox, 4,, Are you sure you wan to exit?
            IfMsgBox Yes
            ExitApp
        }

    else
        ;users first password
        MsgBox, You entered "%UserInput1%"
        ;writing first password to reg
        RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, Software\Password, Password1, %UserInput1%
        ;confirmation of password
        InputBox, UserInput2, Password, Confirm Password, Please Confirm Your Password,
       
            if ErrorLevel
                MsgBox, 4,, Are you sure you wan to exit?
                IfMsgBox Yes
                    ExitApp           
                else
                ;confirmed password
                MsgBox, Your Confirmed Password is "%UserInput2%"
                ;writing second password for conformation
                RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, Software\Password, Password2, %UserInput2%
        ;declaring variables
        s1 = %UserInput1%
        s2 = %UserInput2%
        ;if passwords match...
        if ( s1 == s2)
        {
            MsgBox Passwords Match!!!
            ;asking user to lock the file
            MsgBox, 4,, Would you like to lock the folder
            IfMsgBox Yes
            {
                ;changing the attributes of "lol" to system and hidden
                FileSetAttrib +S+H, C:\lol
                ;renaming "lol" to control panel (if you don't change the attributes and you rename "lol" to "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" and you double click on CP you will enter CP its a good place to hide things)
                FileMoveDir, C:\lol, Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
                MsgBox Folder Successfully Locked!
            }
            else
                MsgBox You  did not lock the folder.
                ExitApp
        }
        Else
            MsgBox Passwords do not match!!
    }
    Else
    {
        ;unlocking the folder
        InputBox, UserInput, password, Enter Unlock Password, Please Enter the Unlock Password.,
        ;reading the password when you locked the folder
        RegRead, OutputVar2, HKEY_LOCAL_MACHINE, SOFTWARE\Password, Password2
        ;declaring the variables
        s1 = %UserInput%
        s2 = %OutputVar2%
       
        ;if passwords match...
        if (s1 == s2)
        {
            ;changing CP's attributes to not hidden, not system
            FileSetAttrib -H-S, Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
            ;renaming CP to lol
            FileMoveDir, Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}, C:\lol
            MsgBox Folder Unlocked Successfully at the location of C:\lol!
            ;this is because you might want to see other hidden folders
            MsgBox, 4,, Would you like to change the registry?
                IfMsgBox Yes
                {
                    ;changing the registry back to 1
                    RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL, CheckedValue, 1
                    MsgBox Registry is changed to 1.
                    ExitApp
                }
                Else
                    MsgBox Registry not changed
        }

        Else
            MsgBox Passwords Do Not Match
    }
}

_________________
Beta. Software undergoes beta testing shortly before it's released. Beta is Latin for "still doesn't work."

The programmer's national anthem is 'AAAAAAAARRRRGHHHHH!!'.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2009, 11:01 am 
Offline

Joined: August 28th, 2009, 10:33 am
Posts: 7
works well.
i like it


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2009, 11:33 am 
Offline

Joined: September 3rd, 2009, 11:26 am
Posts: 93
Hey this is a great Script altho i think you should let the user choose what file is hidden instead of having to use C:\lol


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 4th, 2009, 2:17 am 
Offline

Joined: August 10th, 2009, 8:17 am
Posts: 12
that was the hardest bit when you unlock your folder that you've selected where should it save it to and what should it be called?

_________________
Beta. Software undergoes beta testing shortly before it's released. Beta is Latin for "still doesn't work."

The programmer's national anthem is 'AAAAAAAARRRRGHHHHH!!'.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 4th, 2009, 12:39 pm 
Offline

Joined: September 3rd, 2009, 11:26 am
Posts: 93
u could make it save the path in a registry


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cristi®, Google Feedfetcher and 9 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group