và không cần tạo thư mục locker ở desktop nữa
dưới này là lệnh cmd
@echo off
mode con:cols=80 lines=30
cls
if NOT EXIST “%UserProfile%DesktopLocker” GOTO SETUP
if EXIST “%UserProfile%DesktopLocker*.locker” GOTO CHECKKEY
if NOT EXIST “%UserProfile%DesktopLocker*.locker” GOTO LOCK
:LOCK
mkdir %UserProfile%DesktopLocker >NUL 2>NUL
>nul 2>nul dir /a-d “%UserProfile%DesktopLocker*” && (powershell.exe -executionpolicy bypass “%~dp0lock.ps1”) && (attrib +s -h %UserProfile%DesktopLocker) || (echo No files found in Locker..)
echo.
echo Encryption Process… DONE
pause >NUL
đây là đoạn code powershell
$scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
$desktop = [Environment]::GetFolderPath(“Desktop”)
$templockdir = “$desktopLocker”
$unlockedfiles = Get-ChildItem -Path “$templockdir” -Include “*.txt” -Recurse
$pcname = $env:computername
$lockerkeys = “$dirlockerkeys”