+ Reply to Thread
Results 1 to 2 of 2

Thread: Hide and protect folders with password

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    12

    Hide and protect folders with password

    Hi , i want a batch file which can protect a folder with password and hide it as well , i did that using C# , but i want to know how to do that in batch

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    35
    Code:
    cls
    @ECHO OFF
    echo 			
    title Folder LockFolder
    if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLockFolder
    if NOT EXIST LockFolder goto MDLockFolder
    :AuthConfirm
    echo Are you sure u want to Lock Folder  (Y/N)
    set/p "cho=>"
    if %cho%==Y goto LockFolder
    if %cho%==y goto LockFolder
    if %cho%==n goto END
    if %cho%==N goto END
    echo Invalid choice.
    goto AuthConfirm
    :LockFolder
    ren LockFolder "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    goto End
    :UNLockFolder
    echo Enter password to Unlock Folder
    set/p "pass=>"
    if NOT %pass%==TYPE YOUR PASSWORD goto FailUnlock
    attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" LockFolder
    echo Folder UnLocked!
    goto End
    :FailUnlock
    echo Invalid password!
    echo Try again?  (Y/N)
    set/p "choice=>"
    if %choice%==Y goto UNLockFolder
    if %choice%==y goto UNLockFolder
    if %choice%==N goto END
    if %choice%==n goto END
    :MDLockFolder
    echo

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts