- @echo off
-
-
-
-
- rem ----------diskInfo----------
- echo {
- set diskInfo= "diskInfo":[
- setlocal enabledelayedexpansion
-
- (
- >"%~dp0DiskCalc2.vbs" echo DeviceID = Wscript.Arguments^(0^) / ^(1024*1024*1024^)
- >>"%~dp0DiskCalc2.vbs" echo DeviceID = round^(DeviceID ,2^)
- >>"%~dp0DiskCalc2.vbs" echo WSCript.Echo DeviceID
- )
-
- ver|findstr "5.1" >nul && (
- set "m=ipconfig^|findstr /i "ip address""
- )|| (
- set "m=ipconfig^|findstr /i "ipv4""
- )
- for /f "tokens=14* delims=: " %%1 in ('%m%')do (
- set ipAddress=%%2
- goto :ipAddress
- )
- :ipAddress
- for /f "skip=1 tokens=2,8,12,13" %%a in ('wmic logicaldisk where "DriveType=3" get DeviceID,Size,Caption,Name,FileSystem') do (call :jsdiskSize d "%%d"
- set "diskInfo=!diskInfo!{"ipAddress":"%ipAddress%","diskPath":"%%a","diskName":"%%c","diskSize":"!d!","diskType":"%%b"},"
- )
- if exist "%~dp0DiskCalc2.vbs" del "%~dp0DiskCalc2.vbs"
- echo %diskInfo:~0,-1%]
- echo }
- :end
-
-
-
-
-
- REM 此处代码保持原样,可以在其它代码后,但不要中间断开
- exit/b
- :jsdiskSize
- for /f "delims=" %%a in ('cscript //nologo "%~dp0DiskCalc2.vbs" %~2') do set "%~1=%%aGB"
- goto :eof
复制代码 这个bat是可以运行的,但是不知道那个vbs是啥意思,哪位帮我看看,谢谢 |