- rem 另存为 ANSI 编码 bat
- ' & cls & cscript.exe /nologo /e:vbscript "%~f0" %* & exit /b
-
- S = "192.168.0.254" '教师机的IP或计算机名
- U = "administrator" '用户名
- P = "12345678" '密码
-
- t = ""
- Set oWMI = GetObject("Winmgmts:\\.\Root\Cimv2")
- For Each i In oWMI.InstancesOf("Win32_PhysicalMemory")
- t = t & CInt(i.Capacity / 1024 ^ 3) & "G" & "&"
- Next
- For Each i In oWMI.InstancesOf("Win32_DiskDrive")
- t = t & CInt(i.Size / 1024 ^ 3) & "G" & "&"
- Next
- For Each i In oWMI.InstancesOf("Win32_OperatingSystem")
- n = i.CSName
- Next
-
- Set oWshShell = CreateObject("WScript.Shell")
- oWshShell.Run "net use \\" & S & " " & P & " /user:" & U, 0, True
-
- Set oFSO = CreateObject("Scripting.FileSystemObject")
- Set oTextStream = oFSO.OpenTextFile(n & ".txt", 2, True)
- oTextStream.Write t & n
- oTextStream.Close()
- oFSO.CopyFile n & ".txt", "\\" & S & "\Y\"
复制代码
|