Hello,
I want to display all the printers connected to my computer system except the 'fax' and 'Microsoft Document Image Writer'. Does anyone have any suggestions? I believe my syntax in the IF statement is the problem. This is probably something very simple
I would appreciate any help...
Thanks
var WshNetwork = WScript.CreateObject("WScript.Network");
var WshShell = WScript.CreateObject ( "WScript.Shell" );
//New File System Object Creadted:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\LogFile.txt", true);
var Printers = WshNetwork.EnumPrinterConnections();
var i = Printers;
WScript.Echo("Results have been stored in logfile.txt");
for(i = 0; i < Printers.length; i += 2) {
if ( Printers.Item(i) == "Microsoft Office Document Image Writer" ||
Printers.Item(i) == "Fax") {
WScript.Echo("");
}
a.WriteLine("2Port " +Printers.Item(i)+ " = " + Printers.Item(i + 1));
}
a.Close();
I want to display all the printers connected to my computer system except the 'fax' and 'Microsoft Document Image Writer'. Does anyone have any suggestions? I believe my syntax in the IF statement is the problem. This is probably something very simple
I would appreciate any help...
Thanks
var WshNetwork = WScript.CreateObject("WScript.Network");
var WshShell = WScript.CreateObject ( "WScript.Shell" );
//New File System Object Creadted:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\LogFile.txt", true);
var Printers = WshNetwork.EnumPrinterConnections();
var i = Printers;
WScript.Echo("Results have been stored in logfile.txt");
for(i = 0; i < Printers.length; i += 2) {
if ( Printers.Item(i) == "Microsoft Office Document Image Writer" ||
Printers.Item(i) == "Fax") {
WScript.Echo("");
}
a.WriteLine("2Port " +Printers.Item(i)+ " = " + Printers.Item(i + 1));
}
a.Close();