SUF6NEWBIE
10-21-2004, 02:10 AM
Just a bit of code to show an example of how to use a known
system resource to do a bit of work for you.
Note: this particular one requires Windows XP or later OSs
(there is obviously no error handling code...)
function GetSystemInfo() --get system info to a usable string (for XP or later OSs only)
--first create the cmd file to run the system resource "system32\systeminfo.exe"
--and output the results, when run, to a textfile.
TextFile.WriteFromString(_TempLaunchFolder.."\\~SysInfo.cmd", "@ECHO OFF\r\nTITLE wait one..."
.."\r\nsysteminfo >".." ".._TempLaunchFolder.."\\~sysinfo.dat\r\nExit", false);
File.Run(_TempLaunchFolder.."\\~SysInfo.cmd", "", "", SW_MINIMIZE, true);
local strSysInfo = TextFile.ReadToString(_TempLaunchFolder.."\\~sysinfo.dat");
File.Delete(_TempLaunchFolder.."\\~SysInfo.*", false, false, true, nil); --cleanup
return strSysInfo;
end
--add below code to call at any time during setup eg: startup actions
--as long as is called before the Target Screen is next in Runtime Sequence
--to display information simply place %SysInfo% eg: in scrolling text screen
--(the main body - using edit screen)
SessionVar.Set("%SysInfo%",GetSystemInfo());
system resource to do a bit of work for you.
Note: this particular one requires Windows XP or later OSs
(there is obviously no error handling code...)
function GetSystemInfo() --get system info to a usable string (for XP or later OSs only)
--first create the cmd file to run the system resource "system32\systeminfo.exe"
--and output the results, when run, to a textfile.
TextFile.WriteFromString(_TempLaunchFolder.."\\~SysInfo.cmd", "@ECHO OFF\r\nTITLE wait one..."
.."\r\nsysteminfo >".." ".._TempLaunchFolder.."\\~sysinfo.dat\r\nExit", false);
File.Run(_TempLaunchFolder.."\\~SysInfo.cmd", "", "", SW_MINIMIZE, true);
local strSysInfo = TextFile.ReadToString(_TempLaunchFolder.."\\~sysinfo.dat");
File.Delete(_TempLaunchFolder.."\\~SysInfo.*", false, false, true, nil); --cleanup
return strSysInfo;
end
--add below code to call at any time during setup eg: startup actions
--as long as is called before the Target Screen is next in Runtime Sequence
--to display information simply place %SysInfo% eg: in scrolling text screen
--(the main body - using edit screen)
SessionVar.Set("%SysInfo%",GetSystemInfo());