There are many ways to obtain PC info, local or remote. Below script gathers info with my Std_Out function for Powershell's Get-ComputerInfo. Output could use some work and the argument could be piped to select only certain properties, but since there is little to none interest in any of the Std_Out posts, won't waste any time on those. But I like to throw these out... stir the pot.
;Get Extended Information for a PC
;Script just issues a basic command
;You can limit the output by piping only selected properties
;Should also work on networked PC's - "Invoke-Command -ComputerName 'computername' -ScriptBlock { Get-ComputerInfo }"
;Stan Littlefield 1/29/2026
;==========================================================
Gosub udfs
file = Dirscript():"pcinfo.txt"
If fileexist(file) Then filedelete(file)
args = "Get-ComputerInfo | Out-DataTable"
cmd="Powershell"
msg='Extended Computer Information'
BoxOpen("Running...",cmd:" ":args:@LF:"PLEASE WAIT...MAY TAKE SOME TIME")
TimeDelay(3)
vals = Get_stdout()
Fileput(file,vals)
If FileExist(file) Then Run("notepad.exe",file)
Exit
;==========================================================
:udfs
#DefineSubroutine Get_stdout()
ObjectClrOption("useany","System")
objInfo = ObjectClrNew("System.Diagnostics.ProcessStartInfo")
Output=""
timeOut = ObjectType("I2",5000)
objInfo.FileName = cmd
objInfo.RedirectStandardError = ObjectType("BOOL",@TRUE)
objInfo.RedirectStandardOutput = ObjectType("BOOL",@TRUE)
objInfo.UseShellExecute = ObjectType("BOOL",@FALSE)
objInfo.CreateNoWindow = ObjectType("BOOL",@TRUE)
objInfo.Arguments = args
oProcess = ObjectClrNew("System.Diagnostics.Process")
oProcess.StartInfo = objInfo
BoxShut()
oProcess.Start()
oProcess.WaitForExit(timeout)
STDOUT = oProcess.StandardOutput.ReadToEnd()
STDERR = oProcess.StandardError.ReadToEnd()
Output = Output:STDOUT:@CRLF
If STDERR<>""
Output = Output:"STDERR:":STDERR:@CRLF
Endif
oProcess = 0
objInfo = 0
Return (Output)
#EndSubroutine
Return
;==========================================================
Thanks!
Quote from: kdmoyers on January 29, 2026, 11:08:17 AMThanks!
Appreciate 1 look-see. Script is very basic. Below, I just hacked around explaining how the PS 'select' in pipeline could limit output (with example args= statement). Also cleaned up output to create a tab-delimited string with a header line, suitable for Excel. One maybe issue is that PS returns some properties as object arrays. Don't think that hurts overall as all can be individually queried for content. Again, doubt any interest, but I am happy with the speed and output.
;Get Extended Information for a PC
;Script just issues a basic command
;You can limit the output by piping only selected properties
;Property types: Windows, Bios, Cs, Os, Hyper, Device, KeyboardLayout, TimeZone, LogonServer
;for example if you only needed the PC name and Bios information change to
;args = "Get-ComputerInfo | Select csName,Bios* | Out-DataTable"
;Should also work on networked PC's - "Invoke-Command -ComputerName 'computername' -ScriptBlock { Get-ComputerInfo }"
;Stan Littlefield 1/29/2026
;updated 2/1/2026
;========================================================================================================================
Gosub udfs
file = Dirscript():"pcinfo.txt"
If fileexist(file) Then filedelete(file)
header = "Property":@TAB:"Value":@CRLF
;uncomment, if commented, to select all properties
args = "Get-ComputerInfo | Out-DataTable"
;uncomment, if commented, to select specfic properties
;args = "Get-ComputerInfo | Select csName,Bios* | Out-DataTable"
cmd="Powershell"
msg='Extended Computer Information'
BoxOpen("Running...",cmd:" ":args:@LF:"PLEASE WAIT...MAY TAKE SOME TIME")
TimeDelay(3)
vals = Get_stdout()
;create tab delimited string from stdout(), very crude, could be simplified
vals = StrReplace(vals," ","")
vals = StrReplace(vals," : ","=")
vals = StrReplace(vals,": ","=")
vals = StrReplace(StrTrim(StrReplace(vals, @CRLF, @TAB)), @TAB, @CRLF)
header = header:vals
header = StrReplace(header,"=",@TAB)
;======================================================================
FilePut(file,header)
If FileExist(file) Then Run("notepad.exe",file)
Exit
;======================================================================
:udfs
#DefineSubroutine Get_stdout()
ObjectClrOption("useany","System")
objInfo = ObjectClrNew("System.Diagnostics.ProcessStartInfo")
Output=""
timeOut = ObjectType("I2",5000)
objInfo.FileName = cmd
objInfo.RedirectStandardError = ObjectType("BOOL",@TRUE)
objInfo.RedirectStandardOutput = ObjectType("BOOL",@TRUE)
objInfo.UseShellExecute = ObjectType("BOOL",@FALSE)
objInfo.CreateNoWindow = ObjectType("BOOL",@TRUE)
objInfo.Arguments = args
oProcess = ObjectClrNew("System.Diagnostics.Process")
oProcess.StartInfo = objInfo
BoxShut()
oProcess.Start()
oProcess.WaitForExit(timeout)
STDOUT = oProcess.StandardOutput.ReadToEnd()
STDERR = oProcess.StandardError.ReadToEnd()
Output = Output:STDOUT:@CRLF
If STDERR<>""
Output = Output:"STDERR:":STDERR:@CRLF
Endif
oProcess = 0
objInfo = 0
Return (Output)
#EndSubroutine
Return
;==========================================================