|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
Hello!, thanks
I can't use the wmic because the service is dissabled on my XP's network (wmic logicaldisk where "deviceid='c:'" get volumeserialnumber) I think that one easy way to know the serial number is doing someting like: dir c: > file.txt and now read the serial number from the file. But I don't know how can I do this. (read regular expression from file or from a pipe) thanks J Ford wrote: >With the aide of WMIC... > >:/>wmic logicaldisk where drivetype=3 get name, freespace, systemname, >filesystem, size, volumeserialnumber > >you can change the drivetype value: >0 Unknown >1 No Root Directory >2 Removable Disk >3 Local Disk >4 Network Drive >5 Compact Disc >6 RAM Disk > >You can lookup win32_logicaldisk to get the other properties and methods > > >> hello!, >> >[quoted text clipped - 3 lines] >> >> thanks -- Message posted via WinServerKB.com http://www.winserverkb.com/Uwe/Forum...pting/200709/1 |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
@echo off
setlocal enabledelayedexpansion fsutil fsinfo drives set z_list=abcdefghijklmnopqrstuvwxyz for /l %%a in (0,1,25) do ( set z_drive=!z_list:~%%a,1! call :check-drive !z_drive! ) echo+ echo S/N of C is: !z_sn_c! echo+ pause exit /b :check-drive for /f "tokens=1,2,3" %%a in ('fsutil fsinfo drivetype %~1:\') do ( if /i "%%c"=="fixed" call :getsn %~1 ) goto :eof :getsn for /f "tokens=1,2,3,4,5 skip=1" %%a in ('fsutil fsinfo volumeinfo %~1:\') do ( if /i "%%a %%b %%c"=="Volume Serial Number" ( echo %~1:\ %%e set z_sn_%~1=%%e ) ) goto :eof |
|
|
|
#4 (permalink) |
|
Messages: n/a
Hébergeur: |
Great!,
thanks very much!, its what I was looking for. D.R. wrote: >@echo off >setlocal enabledelayedexpansion > >fsutil fsinfo drives > >set z_list=abcdefghijklmnopqrstuvwxyz > >for /l %%a in (0,1,25) do ( > set z_drive=!z_list:~%%a,1! > call :check-drive !z_drive! >) > >echo+ >echo S/N of C is: !z_sn_c! > >echo+ >pause >exit /b > >:check-drive >for /f "tokens=1,2,3" %%a in ('fsutil fsinfo drivetype %~1:\') do ( > if /i "%%c"=="fixed" call :getsn %~1 >) >goto :eof > >:getsn >for /f "tokens=1,2,3,4,5 skip=1" %%a in ('fsutil fsinfo volumeinfo %~1:\') >do ( > if /i "%%a %%b %%c"=="Volume Serial Number" ( > echo %~1:\ %%e > set z_sn_%~1=%%e > ) >) >goto :eof -- Message posted via http://www.winserverkb.com |
|
![]() |
| Outils de la discussion | |
|
|