报错信息
D:\>pause
请按任意键继续. . .
此时不应有 VALUES('tsgammadb1'。
D:\>echo insert into ADMIN.WIN_DISK_INFO(HOSTNAME,DISK_NAME,TOTAL,AVAIL,USAGE) V
ALUES('tsgammadb1',x,%j,%k,%l);- setlocal enabledelayedexpansion
- set t=1 1
- set t=%t:~1,1%
- echo 盘符 总量 剩余量 未用率 使用率>磁盘信息.txt
- wmic logicaldisk where drivetype=3 get caption,freespace,size>d.txt
- (for /f "skip=1 tokens=1-3" %%i in ('type d.txt') do (
- set s=%%k
- set /a s=!s:~,-3!/1024/1024
- set f=%%j
- set /a f=!f:~,-3!/1024/1024
- set /a wyl=100*!f!/!s!
- set /a syl=100-wyl
- echo %%i,!s!,!f!,!syl!
- ))>>d:\disk.txt
- del d.txt
- pause
- for /f "delims=, tokens=1-4" %%i in ('d:\disk.txt') do (
- pause
- set x='%%i'
- pause
- echo insert%t%into%t%ADMIN.WIN_DISK_INFO(HOSTNAME,DISK_NAME,TOTAL,AVAIL,USAGE)%t%VALUES('tsgammadb1',x,%%j,%%k,%%l);
- pause
- )>>d:\disk2.txt
- pause
复制代码
|