Yes, it's possible.
If you want to add the functionality into the existing batch file from above..
On lines 20 and 29:
Code:
cls
@ECHO OFF
set LOCKFODLER=Locker
set PASSWRD=hellothere
title Folder %LOCKFODLER%
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST %LOCKFODLER% goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren %LOCKFODLER% "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
icacls %LOCKFOLDER%\* /deny Everyone:F
echo Folder locked
goto End
:UNLOCK
echo Enter the Password to unlock folder
set/p "pass=>"
if NOT %pass%== %PASSWRD% goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" %LOCKFODLER%
icacls %LOCKFOLDER%\* /grant Everyone:F
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md %LOCKFODLER%
echo %LOCKFODLER% created successfully
goto End
:End
Line 20 will deny read/write access to the contents of the lock folder:
icacls %LOCKFOLDER%\* /deny Everyone:F
and line 29 will grant access when the correct password is given:
icacls %LOCKFOLDER%\* /grant Everyone:F
Note that this will still display the contents of your lock folder, unless you put everything in a single subfolder.
e.g., if you have c:\locker as your directory that contains all your files and the batch file, and your unlock batch file is under C:\. If there's a file c:\locker\secretDocument.txt, it will be viewable, but not accessible.
So, to alleviate this, put everything in a subfolder of c:\locker. So your file would be in c:\locker\subfolder\secretDocument.txt
They will be able to see subfolder in the explorer window, but unable to open it.
You could also put the icacls command in a separate batch file if you wanted, too.
HOWEVER...
If the person is an administrator on the computer, they can still change the permissions of the folder manually through the file/folder properties > security tab and granting Everyone access again. So, there again... you're going to have to encrypt it, or use some other kind of 3rd party software to deny access if you actually want to be secure.
Edit: did some more testing.. i was able to change permissions on a single file, but not a subfolder; kept giving me an error about no permissions on the subfolder... so if you place everything in a single subfolder that's locked under your locker folder... then it might be fine.. unless they log into the system's Administrator account.