Check volume serial number within a bat file -
im writing batch script run on flash drive. need validate volume serial number of flash drive inside code, therefore nobody should able run different location.
does know how validate serial number inside batch file?
example:
if %vol%==abcd goto else exit
although there several different ways achieve same thing, original dos/windows command intended manage volumes , serial numbers vol
:
@echo off /f "skip=1 tokens=5" %%a in ('vol %~d0') set serial=%%a if %serial% equ abcd-ef01 ( echo valid serial number! )
Comments
Post a Comment