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

Wallet

Newbie
Joined
May 15, 2019
Messages
9
Reaction score
0
Points
1
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"
 

NeiKzz

Junior Member
Joined
Sep 12, 2016
Messages
46
Reaction score
15
Points
8
Telegram
Chat with me via Yahoo Messenger
Skype
Chat with me via Skype
Nếu cần thì liên hệ telegram mình :D
 

Jukio

Senior Member
Joined
Dec 17, 2019
Messages
366
Reaction score
104
Points
43
Skype
Chat with me via Skype
ICQ
Chat with me via ICQ
lên tham khảo cấu trúc powershell đó bác
 

Announcements

Advertises

Forum statistics

Threads
352,589
Messages
6,171,810
Members
127,897
Latest member
Thanhcho

Follow us

Top