通过一个Bat,把本机上的
1.系统信息【用systemiffo命令】,
2.IP信息【用ipconfig/all命令】,
3.把所有盘上的文件以tree树状形式保存,
获取信息后生成一个以用户名命名+information.txt的文件保存在可移动盘上,该如何操作?
若有多个可移动盘存在,仅保存在打开该bat的当前盘上又该如何?
以下代码仅是能达到第3的功能:请各位帮忙补充完整。谢谢。- @echo off&setlocal enabledelayedexpansion
- for /f "skip=1 delims=" %%a in ('wmic logicaldisk where ^(drivetype^="2"^) get deviceid') do (
- set "aa=%%a"
- if exist "!aa:~,2!\" (
- (for %%b in (c d e f g) do tree %%b:\)>"!aa:~,2!\%computername% —information.txt"
- )
- )
- pause
复制代码
|