Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var bFound=false;
var shost=".";
var svc=GetObject("WinMgmts:\\\\"+shost+"\\root\\cimv2");
var squery="select name, attributes, location from win32_printer";
var cprtr=svc.ExecQuery(squery);
var e=new Enumerator(cprtr);
for (;!e.atEnd();e.moveNext()) {
if ((e.item().attributes & 4) == 4) {
//location can be null meaning unknown
WScript.Echo ("Default printer : " + e.item().name + "\n" + "Printer location : " + e.item().location);
e.moveLast;
bFound = true;
}
}
if (!bFound) WScript.Echo ("Default printer not found.")