Skip to content

Instantly share code, notes, and snippets.

@shvargon
Last active November 1, 2024 08:39
Show Gist options
  • Select an option

  • Save shvargon/8bb9e2beeda130ebb70009caae7ecdc4 to your computer and use it in GitHub Desktop.

Select an option

Save shvargon/8bb9e2beeda130ebb70009caae7ecdc4 to your computer and use it in GitHub Desktop.
Windows Drive Serial number
@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