Lệnh cmd mở và quản lý tập tin/thư mục trên windows
1. Ẩn file zip hoặc rar trong ảnh:
copy /b image.extension+folder.zip image.extension
2. Mã hóa file trong thư mục:
cipher /E
3. Ẩn thư mục với mọi người:
attrib +h +s +r tên_thư_mục
Để bỏ ẩn, sử dụng lệnh này:
attrib -h -s -r tên_thư_mục
4. Xóa các tập tin tạm thời để giải phóng dung lượng
del /q /f /s %temp%\\*
del /s /q C:\\Windows\\temp\*
5. Lệnh kiểm tra và sửa lỗi ổ cứng máy tính ( Run as administrator)
chkdsk c: /f
6. Xem lại lịch sử các lệnh:
doskey /history
7. Lưu đầu ra của lệnh vào một tệp:
lệnh cmd >> D:\\output.txt
Lệnh cmd về hệ thống
1. Lệnh cập nhật thời gian cho máy tính:
Xem danh sách public time Server tại đây
w32tm /config /manualpeerlist:”2.vn.pool.ntp.org time.windows.com” /syncfromflags:manual /reliable:yes /update
w32tm /config /update
- Restart the time service
net stop w32time
net start w32time
- Resync the time
w32tm /resync
using w32tm /resync /rediscover will also “force redetection of network resourced before resynchronization.”
- Verify your sync status
w32tm /query /status
W32tm /query /computer:contosoW1 /configuration
- To list out peers
w32tm /query /peers
- To list out NTP Sources:
w32tm /query /source
2. Hiển thị chi tiết thông tin hệ điều hành và cấu hình hệ thống
systeminfo
3. Sao chép an toàn các tập tin giữa các máy chủ từ xa
scp file.txt root@serverip:~/file.txt
4. Mở CMD trong thư mục windows hiện tại
Gõ “CMD” trên thanh tìm kiếm
5. Mở internet options từ cmd của windows
inetcpl.cpl
6.Mở Network Connections
ncpa.cpl
7. Mở Programs and Features để xoa phần mềm cài đặt trên Windows
appwiz.cpl
8. Mở Registry Editor
regedit
9. Mở Local group policy editor
gpedit.msc
10. Lệnh kiểm tra và sửa lỗi ổ địa bị bad sector, các lỗi logic hoặc vật lý khác
chkdsk c: /f
11. Mở System File Checker là một công cụ quét và sửa chữa tự động tập trung vào các file hệ thống Windows
sfc /scannow
Lệnh cmd về mạng
1. Lệnh Net Use tạo ánh xạ một ổ đĩa mạng (map network drive)
net use Z: “\\OTHER-COMPUTER\SHARE” /persistent:yes
2. Curl các liên kết rút gọn (Shortened Links) để tìm ra đích liên kết
curl –head –location “https://voz.ee/s/P-AzXwNNy” | findstr “Location”
3. Kiểm tra trạng thái của trang web
Curl -IsL http://ictcenter.net
4. Kiểm tra địa chỉ IP public của bạn
curl checkip.amazonaws.com
5. Tạo mã QR:
Curl qrenco.de/https://ictcenter.net
6. Hiển thị tất cả mật khẩu wifi:
Đầu tiên hiển thị danh sách các mạng WiFi
netsh wlan show profile
Thứ hai, hiển thị mật khẩu
netsh wlan show profile tên_wfi key=clear | findstr “Key Content”
Để xem mật khẩu tất cả các mạng WiFi
for /f “skip=9 tokens=1,2 delims=:” %i in (‘netsh wlan show profiles’) do @if “%j” NEQ “” (echo SSID: %j & netsh wlan show profiles %j key=clear | findstr “Key Content”) & echo
7. Tạo một tệp wifi.bat hiển thi tên và mật khẩu wifi
@echo off
@echo off
setlocal enabledelayedexpansion
for /f “tokens=2delims=:” %%a in (‘netsh wlan show profile ^|findstr “:”‘) do (
set “ssid=%%~a”
call :getpwd “%%ssid:~1%%”
)
:getpwd
set “ssid=%*”
for /f “tokens=2delims=:” %%i in (‘netsh wlan show profile name^=”%ssid:”=%” key^=clear ^| findstr /C:”Key Content”‘) do echo ssid: %ssid% pass: %%i