Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 需要一个基本的批处理文件脚本用于服务器上的运行状况检查_Batch File - Fatal编程技术网

Batch file 需要一个基本的批处理文件脚本用于服务器上的运行状况检查

Batch file 需要一个基本的批处理文件脚本用于服务器上的运行状况检查,batch-file,Batch File,我正在寻找一个简单的批处理文件,可以给我以下服务器列表的详细信息。只有一个域 主机名 IP地址 领域 磁盘细节 CPU信息 物理存储器 操作系统详细信息 服务器类型 我自己做了一个,但它似乎不是为一个服务器列表运行的,它只是为一个服务器运行了很多次。请帮助我,下面是代码: for /f %%x in (computers.txt) do systeminfo | findstr /c:"Host Name" >> C:\temp\output.txt for /f %%x in

我正在寻找一个简单的批处理文件,可以给我以下服务器列表的详细信息。只有一个域

  • 主机名
  • IP地址
  • 领域
  • 磁盘细节
  • CPU信息
  • 物理存储器
  • 操作系统详细信息
  • 服务器类型
我自己做了一个,但它似乎不是为一个服务器列表运行的,它只是为一个服务器运行了很多次。请帮助我,下面是代码:

for /f %%x in (computers.txt) do systeminfo | findstr /c:"Host Name" >> C:\temp\output.txt
for /f %%x in (computers.txt) do wmic cpu get name >> C:\temp\output.txt
for /f %%x in (computers.txt) do systeminfo | findstr /c:"Domain" >> C:\temp\output.txt
for /f %%x in (computers.txt) do systeminfo | findstr /c:"OS Name" >> C:\temp\output.txt
for /f %%x in (computers.txt) do systeminfo | findstr /c:"OS Version" >> C:\temp\output.txt
for /f %%x in (computers.txt) do systeminfo | findstr /c:"System Manufacturer" >> C:\temp\output.txt
for /f %%x in (computers.txt) do systeminfo | findstr /c:"System Model" >> C:\temp\output.txt
for /f %%x in (computers.txt) do systeminfo | findstr /c:"System type" >> C:\temp\output.txt
for /f %%x in (computers.txt) do systeminfo | findstr /c:"Total Physical Memory" >> C:\temp\output.txt
for /f %%x in (computers.txt) do ipconfig | findstr IPv4 >> C:\temp\output.txt
for /f %%x in (computers.txt) do wmic diskdrive get size >> C:\temp\output.txt
for /f %%x in (computers.txt) do dsquery computer -name %%x >> C:\temp\output.txt

如果我假设您在
computers.txt
中获得了服务器名称列表

  • 传递给系统信息命令的服务器名称在哪里
  • 代码中使用的for循环迭代
    computers.txt
    中的所有行,并提供机器的系统信息输出,在该机器上执行每个非预期的迭代
  • 3.此过程将继续,直到在
    computers.txt
    中迭代所有行

  • 使用以下选项,通过在代码中使用命令从服务器获取系统信息,如下所示:
  • systeminfo/s/U/p