کد:
:: **** By n1maSSTO **** & My Friends MR.Shirin Zaban,Borhan,Hunter,H_F_G!****
@setlocal enableextensions
@echo off
:: ****** Customization ******
Title *** n1ma's Folder Lock***
MODE CON: COLS=44 LINES=16
Color 1E
::Check OS
ver|find "NT">nul&&(
cls
echo.
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ ؛
echo ؛ Windows 7/Vista/Xp Only ؛
echo ؛ ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
ping 127.0.0.1 -n 4 >nul
goto:eof
)
:: ****** Checking 32/64 Bit Version ******
:OS
IF defined ProgramFiles(x86) (
Set OO=%Windir%\SysWOW64&goto UnCheck
) else (
Set OO=%Windir%\System32&goto UnCheck
)
:: ****** Uninstallation Check ******
:UnCheck
IF EXIST "%temp%\Uninstallation.Alp" (
goto Unin >nul
) ELSE (
IF Exist "%temp%\Alpha.exe" (
Del "%temp%\Alpha.exe" /Q >nul &goto Check >nul
) Else (
goto Check >nul
)
goto Check >nul
)
:: ****** Checking For Pre-Installation ******
:Check
IF EXIST "%OO%\Alpha.exe" (
IF Exist "%APPDATA%\Folderlock\MasterPassword.txt" (
goto CheckMasPass >nul
) Else (
goto MasPass >nul
)
) ELSE (
goto Start >nul
)
:: ******* Reinstall Section ******
:CInstall
cls
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Software Installation is Curropted ؛
echo ؛ ؛
echo ؛ You'll Need To Reinstall ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
echo Press Enter To Do So. &pause>nul &goto start
:: ****** Getting Started! ******
:Start
::**** Check for ADMIN Privileges & Installing ****
:ADMIN
@echo off
AT > NUL
IF %ERRORLEVEL% EQU 0 (
pushd "%cd%" >nul
cd /d "%~dp0" >nul
) else (
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\n1ma.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\n1ma.vbs"
"%temp%\n1ma.vbs" >nul
del "%temp%\n1ma.vbs" >nul
exit
)
::****** Installation Menu ******
:Install
title Folderlock Installation!
cls
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Application Needs to Install ؛
echo ؛ ؛
echo ؛ Itself. Confirm? (Y/N) (Y=Yes,N=No) ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
Set "UserInp=0"
Set /p "UserInp= "
set UserInp=%UserInp:~0,1%
If /i %UserInp%==Y goto InstallNow
If /i %UserInp%==N goto:eof
goto Install
:: ****** Copy Files ******
:InstallNow
Set NAME=%~nx0
Copy "%~f0" "%OO%" /Y >nul
ren "%OO%\%NAME%" "Alpha.exe"
:: ****** Adding to RightClick Menu *******
:RightClickAsk
cls
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Add Software To Right Click ؛
echo ؛ ؛
echo ؛ Menu? (Y/N) ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
Set "UserInp=0"
Set /p "UserInp= "
set UserInp=%UserInp:~0,1%
If /i %UserInp%==Y Goto RightClick
If /i %UserInp%==N Goto DoneIns
goto RightClickAsk
:RightClick
Call set APAN="%OO%\Alpha.exe"
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Run Folderlock" /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Run Folderlock\Command" /ve /d "%APAN% %1" /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Run Folderlock" /v Icon /t REG_SZ /d "%OO%\SHELL32.dll,47" /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Run Folderlock" /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Run Folderlock\Command" /ve /d "%APAN% %1" /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Run Folderlock" /v Icon /t REG_SZ /d "%OO%\SHELL32.dll,47" /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Run Folderlock" /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Run Folderlock\Command" /ve /d "%APAN% %1" /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Run Folderlock" /v Icon /t REG_SZ /d "%OO%\SHELL32.dll,47" /f >nul
Set DoneRight=^echo ^؛^Software Was Added To Right Click Menu^؛
Set DoneRight2=^echo ^؛^ ؛
:: ****** Installation MSG ******
:DoneIns
cls
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Installation Completed! ؛
echo ؛ ؛
%DoneRight%
%DoneRight2%
echo ؛ Run Application Again. ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
pause>nul&goto:eof
:: ******* Request Master Password *******
:CheckMasPass
Cls
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Enter Your Master Password ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
set/pPASS=
If not Defined PASS goto CheckMasPass
Cacls "%APPDATA%\Folderlock\MasterPassword.txt" /e /c /g %Username%:f>nul
Attrib -r -h -s "%APPDATA%\Folderlock\MasterPassword.txt" >nul
Set /P RPASS=< "%APPDATA%\Folderlock\MasterPassword.txt"
cacls "%APPDATA%\Folderlock\MasterPassword.txt" /e /c /d %Username%>nul
IF %PASS%==%RPASS% (
goto Menu
) Else (
goto MasPassFail >nul
)
:MasPassFail
cls
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Entered Password Is Not Correct ؛
echo ؛ ؛
echo ؛ Press Enter To Try Again ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
Pause>nul &goto CheckMasPass
:: ****** Master Password ******
:MasPass
Cls
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Create Your Own Master Password ؛
echo ؛ ؛
echo ؛ Enter It Down Below ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
set/pPASS=
If not Defined PASS goto MasPass
IF /i %PASS%=="" echo error &pause
IF Not Exist "%APPDATA%\Folderlock" MD "%APPDATA%\Folderlock"
IF Exist "%APPDATA%\Folderlock\MasterPassword.txt" (
Cacls "%APPDATA%\Folderlock\MasterPassword.txt" /e /c /g %Username%:f >nul
Attrib -r -h -s "%APPDATA%\Folderlock\MasterPassword.txt" >nul
Del "%APPDATA%\Folderlock\MasterPassword.txt" /Q >nul
Echo %PASS% >"%APPDATA%\Folderlock\MasterPassword.txt"
cacls "%APPDATA%\Folderlock\MasterPassword.txt" /e /c /d %Username% >nul
) ELSE (
Echo %PASS% >"%APPDATA%\Folderlock\MasterPassword.txt"
cacls "%APPDATA%\Folderlock\MasterPassword.txt" /e /c /d %Username% >nul
)
goto Menu
:: ****** Program's Menu ******
:Menu
MODE CON: COLS=44 LINES=18
cls
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ** Lock Your Folder Menu ** ؛
echo جحححححححححححححححححححححححححححححححححححححح¹
echo ؛ ؛
echo ؛ (L).Lock/Unlock My Folder ؛
echo ؛ (C).Change Master Password ؛
echo ؛ (N).Uninstall Application ؛
echo ؛ (A).About this program ؛
echo ؛ (X).Exit ؛
echo ؛ ؛
echo ؛ ###################### ؛
echo ؛ ؛
echo ؛ Select One of above options then ؛
echo ؛ Type L,C,A,N or X and press Enter ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
Set "UserInp=0"
Set /p "UserInp= "
set UserInp=%UserInp:~0,1%
If /i %UserInp%==L goto alpha
if /i %UserInp%==C goto CMasPass
if /i %UserInp%==N goto Uninstall
if /i %UserInp%==A goto ABOUT
if /i %UserInp%==X goto:eof
goto menu
:: ****** Modes ******
:alpha
cls
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Drag and drop your folder to this ؛
echo ؛ ؛
echo ؛ window, Then Press Enter ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
set/pVAR= &goto prm
:: ****** Distinguish File From Folder ******
:prm
if not Defined VAR goto alpha
FOR %%i IN (%VAR%) DO IF EXIST %%~si\NUL goto DETECT
cls
ECHo.
ECHo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Procces Failed!! Invalid Path. ؛
echo ؛ ؛
echo ؛ Notice That Only Folders are allowed ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
Echo Press Enter To Try Again. &Pause>nul&goto alpha
:: ****** Lock It Or Unlock It?!! ******
:DETECT
echo ASAP >%VAR%\ASAP.txt
IF EXIST %VAR%\ASAP.txt (
Del %VAR%\ASAP.txt /Q &goto Beta
) ELSE (
goto Delta
)
:: ****** Locking Part ******
:Beta
cls
ECHo.
echo ةححححححححححححححححححححححححححححححححححححححح»
echo ؛ How You'd Like Your folder look like? ؛
echo جححححححححححححححححححححححححححححححححححححححح¹
echo ؛ ؛
echo ؛ (C).Control Panel ؛
echo ؛ (R).Recycle Bin ؛
echo ؛ (U).User Accounts ؛
echo ؛ (S).System Properties ؛
echo ؛ (M).My Computer ؛
echo ؛ ؛
echo ؛ Select One of above options then ؛
echo ؛ Type C,R,U,S or M and press Enter ؛
echo ؛ ؛
echo بححححححححححححححححححححححححححححححححححححححح¼
Set "ICON=0"
Set /p "ICON=|>"
set ICON=%ICON:~0,1%
If /i %ICON%==C Set APANN={26EE0668-A00A-44D7-9371-BEB064C98683} &goto ABETA
If /i %ICON%==R Set APANN={645FF040-5081-101B-9F08-00AA002F954E} &goto ABETA
If /i %ICON%==U Set APANN={60632754-c523-4b62-b45c-4172da012619} &goto ABETA
If /i %ICON%==S Set APANN={BB06C0E4-D293-4f75-8A90-CB05B6477EEE} &goto ABETA
If /i %ICON%==M Set APANN={20d04fe0-3aea-1069-a2d8-08002b30309d} &goto ABETA
goto Beta
:: ******* Locking Part Final ********
:ABETA
cacls %VAR% /e /c /g %Username%:f >nul
icacls %VAR% /grant Administrator:f >nul
attrib -r -s -h %VAR% >nul
attrib -r -s -h %VAR%\Desktop.ini >nul
IF Exist %VAR%\Desktop.ini del %VAR%\Desktop.ini /Q >nul
set str1=
echo [.ShellClassInfo] 1>%VAR%\Desktop.ini
set str2=
echo CLSID=%APANN% 1>>%VAR%\Desktop.ini
attrib +s +h +r %VAR%
attrib -s -h -r %VAR%
attrib +s +h +r %VAR%\Desktop.ini
attrib +s +r %VAR%
echo ASAP >%VAR%\ASAP.txt
IF EXIST %VAR%\ASAP.txt (
Del %VAR%\ASAP.txt /Q &Set ASAS=wmic.exe ^Process Where Name^=^"^explorer.exe^" ^Call ^TERMINATE
) ELSE (
Set ASAS=ECHO Nope
)
%ASAS%
cacls %VAR% /e /c /d %Username% >nul
Set COM=^echo ^؛ ** Completed!! ** ^؛
goto Menu2
:: ****** Unlocking Part ******
:Delta
cacls %VAR% /e /c /g %Username%:f >nul
attrib -r -h -s %VAR% >nul
attrib -r -s -h %VAR%\Desktop.ini >nul
del %VAR%\Desktop.ini >nul
echo ASAP >%VAR%\ASAP.txt
IF EXIST %VAR%\ASAP.txt (
Del %VAR%\ASAP.txt /Q &Set COM=^echo ^؛ ** Completed!! ** ^؛ &goto Menu2
) ELSE (
goto FAIL
)
:: ****** Fail Section ******
:FAIL
ECHo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Proccess Failed ! ؛
echo ؛ ؛
echo ؛ Unknown Error Occured !! ؛
echo ؛ ؛
echo ؛ Report This To The Developer!!! ؛
echo ؛ ؛
echo ؛ Sorry!!!! ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
Echo Press Enter To Go Back To Menu & pause>nul&goto Menu
:: ****** Change Master Password ******
:CMasPass
cls
ECHo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ To Change Your Master Password ؛
echo ؛ ؛
echo ؛ Enter Your New Master Password ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
set/pPASS=
If not Defined PASS goto CMasPass
IF /i %PASS%=="" echo ds
pause
IF Not Exist "%APPDATA%\Folderlock" MD "%APPDATA%\Folderlock"
IF Exist "%APPDATA%\Folderlock\MasterPassword.txt" (
Cacls "%APPDATA%\Folderlock\MasterPassword.txt" /e /c /g %Username%:f >nul
Attrib -r -h -s "%APPDATA%\Folderlock\MasterPassword.txt" >nul
Del "%APPDATA%\Folderlock\MasterPassword.txt" /Q >nul
Echo %PASS% >"%APPDATA%\Folderlock\MasterPassword.txt"
cacls "%APPDATA%\Folderlock\MasterPassword.txt" /e /c /d %Username% >nul
) ELSE (
Echo %PASS% >"%APPDATA%\Folderlock\MasterPassword.txt"
cacls "%APPDATA%\Folderlock\MasterPassword.txt" /e /c /d %Username% >nul
)
Set COM=^echo ^؛ ** Master Password Changed!! ** ^؛
goto menu2
::: ****** Second Menu ******
:Menu2
cls
echo.
echo.
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ ؛
%COM%
echo ؛ ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
ping 127.0.0.1 -n 5 >nul
goto Menu >nul
:: ****** About Developers ******
:ABOUT
MODE CON: COLS=50 LINES=18
cls
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ This Batch File Was Designed By ؛
echo ؛ ؛
echo ؛ n1maSSTO ^& Mr.Shirin Zaban! ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
echo +------------+
echo // LOCK A FOLDER ! For PC Lovers!! VERSION 1.6
echo +----------+
echo.
echo Copyright © 2012 n1maSSTO. All Rights Reserved.
echo.
Echo Press Enter To Continue & pause>nul&goto Menu
:: ****** Uninstallation Menu ******
:Uninstall
cls
title Uninstallation
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ The Application Is Uninstalling ؛
echo ؛ ؛
echo ؛ Itself. Confirm? (Y/N) (Y=Yes,N=No) ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
:Uninstall2
set/p "HH=>"
if %HH%==Y goto UninstallNow
if %HH%==y goto UninstallNow
if %HH%==N goto Menu
if %HH%==n goto Menu
echo Invalid Choice! Try Again: &goto Uninstall2
:: ****** Making Temporary File For Uninstalling ******
:UninstallNow
echo Hi There!! >> "%temp%\Uninstallation.Alp"
Copy "%OO%\Alpha.exe" "%temp%" /Y >nul
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\n1ma.vbs"
echo UAC.ShellExecute "%temp%\Alpha.exe", "", "", "runas", 1 >> "%temp%\n1ma.vbs"
"%temp%\n1ma.vbs" >nul
del "%temp%\n1ma.vbs" >nul
exit
:: ****** Uninstallation ******
:Unin
cls
title Uninstallation
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Run Folderlock" /f >nul
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Run Folderlock" /f >nul
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Run Folderlock" /f >nul
del "%OO%\Alpha.exe" /Q
del "%temp%\Uninstallation.Alp" /Q
Cacls "%APPDATA%\Folderlock\MasterPassword.txt" /e /c /g %Username%:f >nul
del "%APPDATA%\Folderlock" /Q >nul
:A
cls
echo.
echo.
echo ةحححححححححححححححححححححححححححححححححححححح»
echo ؛ ؛
echo ؛ Uninstallation Completed!! ؛
echo ؛ ؛
echo بحححححححححححححححححححححححححححححححححححححح¼
echo.
echo.
echo Press Enter To Complete Uninstallation.
pause>nul
Exit
علاقه مندی ها (بوک مارک ها)