Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Odd Output Problem

Status
Not open for further replies.

BKearan

IS-IT--Management
Sep 27, 2007
45
US
All of a sudden my scripts started having this problem.

I used logfile.writeline to output to an opened for writing csv file. It was working fine. No changes to script. Then...
well, I start getting this:

Code:
Computername1
????????????
Computername2
???????????????????? Computername2
????????????????????,Computername2
??????????????????????????????????????????

The computer names are the only thing showing up right - and that is stored in a variable.
Should be displaying like:
Code:
Computername1
Computer not responding to ping
Computername2
(Date & Time) Starting copy to Computername2
(Date & Time) ,Copy complete to Computername2

A code snippet:

Code:
If strTuner <> "True" Then
	LogFile.Write strPCName & vbCrLf
	wscript.echo now & " - starting copy to " & strPCName
	LogFile.Write "," & now & ",starting copy to " & strPCName & vbCrLf
	Set wshShell = CreateObject("WScript.Shell")
	intRC = wshShell.run(strRem1, 1, true) 
	wscript.echo now & " - copy complete " & intRC & " " & intRC.description
	LogFile.Write "," & now & ",copy complete to," & strPCName & vbCrLf

I don't think its a code issue, because it worked for a long time as it is. Thinking maybe a windows update added a "feature" that caused this. Have no idea how to fix it though.
 
Just noticed that the Wscript.Echo is rendering the text just fine, but is not showing the variable contents. (strCompuer)
 
The strPCName if it is read from a file and failed to get it, it may probably be because the text previously is saved in one format (for instance, ascii) and now in another format (for instance, unicode) or vice versa. Similarly for output. If the logfile is previously opened for inspection in one utility or text editor in one format and now in another... First identify if strPCName input is read properly. Play with the format argument in opentextfile or openastextstream method of fso.
 
That pointed me down the right direction. I deleted and re-created my hostlist and added ,0 on both the read and write text files.
It looks like it is running a LOT better - as in it is actually running again instead of just looping through real fast.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top