Last active
November 1, 2024 08:39
-
-
Save shvargon/8bb9e2beeda130ebb70009caae7ecdc4 to your computer and use it in GitHub Desktop.
Windows Drive Serial number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| :: Проверяем, запущен ли скрипт от имени администратора | |
| net session >nul 2>&1 | |
| if %errorlevel% neq 0 ( | |
| echo Elevation to administrator... | |
| powershell -Command "Start-Process '%~f0' -Verb RunAs" | |
| exit /b | |
| ) | |
| :: Выполнение команды | |
| wmic diskdrive get model,deviceid,serialnumber | |
| :: Ожидание нажатия клавиши перед выходом | |
| echo. | |
| echo Press any key to exit... | |
| pause >nul |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment