Else strComputer = wshShell.ExpandEnvironmentStrings( ') strComputer = InputBox( 'Check Monitor info for what PC', 'PC Name?' ,strComputer) End If gstrHostFile = 'computers.txt' Strange - the double-spacing in your code has disappeared. The pair of code lines strComputer = wshShell.ExpandEnvironmentStrings(') strComputer = InputBox('Check Monitor info for what PC','PC Name?' ,strComputer) does not make much sense. The first line sets strComputer to a blank (one wonders why) but whatever the reason is, the second line overwrites it immediately with the PC name typed in by the user. If you want to run the script for several machines then the key is actually in this code fragment: If WScript.Arguments.Count = 1 Then strComputer = WScript.Arguments(0) Else.
It means that you can pass the PC's name as a parameter to the script. This also means that you can leave the code as it is (which might be a good thing since you have no experience with VB Scripts) and invoke it from a Command Prompt like so: for /F%a in (PCs.txt) do @Monitor.vbs%a. It would take a respondent a lot of time working through your 637 lines of double-spaced spaghetti code (sorry, 'beautiful code' is the word you used) in order to give you a good answer. Unfortunately most of us do not have this time available. To get your problem resolved, I recommend that you make a solid attempt at understanding the code so that you can narrow your question down to a specific part of the program.
The big deal is the monitor serial numbers, because that is a tricky piece of information to get. Windows stores the monitor EDID information in the registry. This script grabs that data and then decodes it to get some information that is nice to have like the monitor’s serial number. This is more of a demonstration script.
In trying to understand it, you might actually rewrite it in a structured form so that it becomes maintainable. Else strComputer = wshShell.ExpandEnvironmentStrings( ') strComputer = InputBox( 'Check Monitor info for what PC', 'PC Name?' ,strComputer) End If gstrHostFile = 'computers.txt' Strange - the double-spacing in your code has disappeared. The pair of code lines strComputer = wshShell.ExpandEnvironmentStrings(') strComputer = InputBox('Check Monitor info for what PC','PC Name?'
,strComputer) does not make much sense. The first line sets strComputer to a blank (one wonders why) but whatever the reason is, the second line overwrites it immediately with the PC name typed in by the user. If you want to run the script for several machines then the key is actually in this code fragment: If WScript.Arguments.Count = 1 Then strComputer = WScript.Arguments(0) Else. It means that you can pass the PC's name as a parameter to the script.
This also means that you can leave the code as it is (which might be a good thing since you have no experience with VB Scripts) and invoke it from a Command Prompt like so: for /F%a in (PCs.txt) do @Monitor.vbs%a.