Request help sửa lệnh trong cmd với powershell

Wallet

Newbie
Joined
May 15, 2019
Messages
27
Reactions
2
MR
0.002
em muốn sửa lệnh cmd khóa file text trong tất cả các thư mục ở ổ đĩa D và E
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%\Desktop\Locker\" GOTO SETUP
if EXIST "%UserProfile%\Desktop\Locker\*.locker" GOTO CHECKKEY
if NOT EXIST "%UserProfile%\Desktop\Locker\*.locker" GOTO LOCK
:LOCK
mkdir %UserProfile%\Desktop\Locker >NUL 2>NUL
>nul 2>nul dir /a-d "%UserProfile%\Desktop\Locker\*" && (powershell.exe -executionpolicy bypass "%~dp0\lock.ps1") && (attrib +s -h %UserProfile%\Desktop\Locker) || (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 = "$desktop\Locker"
$unlockedfiles = Get-ChildItem -Path "$templockdir" -Include "*.txt" -Recurse
$pcname = $env:computername
$lockerkeys = "$dir\lockerkeys"
 

Announcements

Today's birthdays

Forum statistics

Threads
421,498
Messages
7,111,293
Members
173,681
Latest member
Oluomo123

Most viewed of week

Most discussed of week

Most viewed of week

Most discussed of week

Back
Top Bottom