[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
test.bat
  1. @echo off
  2. powershell -f test.ps1 > 1.txt
复制代码
test.ps1
  1. gwmi win32_logicaldisk -filter "drivetype = 3" | % {
  2.     $_.deviceid + "`t" + `
  3.     ($_.size/1GB).tostring("f2") + "`t`t" + `
  4.     ($_.freespace/1GB).tostring("f2") + "`t`t" + `
  5.     ($_.size/1GB-$_.freespace/1GB).tostring("f2") + "`t`t" + `
  6.     (($_.size-$_.freespace)/$_.size*100).tostring("f2") + "%"
  7. }
复制代码
环境所限,需要使用 PowerShell 2.0 版本。

TOP

返回列表