2marshall8
Technical User
I need a way to output the computer name of a machine to a text file w/o the carriage return at the end. I know how to do this using batch files and echo but it includes this carriage return which messes other parts of my script up. If you have any advice on this I would greatly appreciate it. Here is what I have, but I just need a way to direct this echo command into a text file
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For Each objItem In colItems
computerName = objItem.name
wscript.echo computerName
Next
marshall
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For Each objItem In colItems
computerName = objItem.name
wscript.echo computerName
Next
marshall