fba44 Posted October 12, 2013 Author Share Posted October 12, 2013 hocam tşk ederim akşam eve gidince hemen deneyeceğim. İnşallah bekleyen yazı kısmınıda halledebilirsiniz. Tekrar tşkler. Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted October 12, 2013 Editor Share Posted October 12, 2013 printername = "Microsoft XPS Document Writer"; sAdet = 0; function Escape(v) if (v == nil) then return ""; end if (type(v) == "table") then return Table.Concat(v, ", "); end if (type(v) == "boolean") then if (v == true) then return "Yes"; else return "No"; end end return v; end local sOutput = ""; local oWMIService = luacom.GetObject("winmgmts:\\\\localhost\\root\\CIMV2"); local oColItems = oWMIService:ExecQuery("SELECT * FROM Win32_PrintJob", "WQL", 48); if oColItems then local oEnum = luacom.GetEnumerator(oColItems); local oItem = oEnum:Next(); while oItem do Dialog.Message("",printername .. " == " .. String.Mid(Escape(oItem:Caption()), 1, (#Escape(oItem:Caption()) - 3))); if printername == String.Mid(Escape(oItem:Caption()), 1, (#Escape(oItem:Caption()) - 3)) then sAdet = sAdet + String.ToNumber(Escape(oItem:PagesPrinted())); end oItem = oEnum:Next(); end else Dialog.Message("WMI Output", "Win32_PrintJob Kütüphanesi bulunamadı."); end Dialog.Message("","Yazdırılan sayfalar : " ..sAdet); Bu kodlarlada yukarıda printername değişkenine yazdıgın yazıcı ismine ait adetleri çekebilirsiniz yani kuyruktakileri. Quote Link to comment Share on other sites More sharing options...
fba44 Posted October 13, 2013 Author Share Posted October 13, 2013 (edited) hocam bu kaç belge olduğunu gösteren kod çalışmadı bir eksiklikmi var acaba yanlış birşey mi yapıyorum yoksa siz denediniz mi ? Edit: Tamam hocam halletim peki "kuyruğu sil" yapabilirmiyiz Edited October 13, 2013 by fba44 Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted October 13, 2013 Editor Share Posted October 13, 2013 net stop spooler DEL %systemroot%\system32\spool\printers\*.shd DEL %systemroot%\system32\spool\printers\*.spl net start spooler Silme işlemini cmd komutlarıylada yapabilrisiniz. Quote Link to comment Share on other sites More sharing options...
fba44 Posted October 13, 2013 Author Share Posted October 13, 2013 net stop spooler DEL %systemroot%\system32\spool\printers\*.shd DEL %systemroot%\system32\spool\printers\*.spl net start spooler Silme işlemini cmd komutlarıylada yapabilrisiniz. Evet bu şekilde projeye bir önbellek silme işlemi ekledim fakat bu tüm yazıcıların belleğini siliyor benim kastettiğim ise sadece belirttiğim yazıcının kuyruğunu silmek Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted October 14, 2013 Editor Share Posted October 14, 2013 printername = "Kyocera" vbscript = [[ strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM Win32_Printer",,48) For Each objItem in colItems IF objItem.Name = ]] vbscripttwo = [[ THEN objItem.CancelAllJobs() END IF Next ]] TextFile.WriteFromString(_TempFolder.."\\clean.vbs", vbscript .. "\""..printername.."\"" .. vbscripttwo, false); result = Shell.Execute(_TempFolder.."\\clean.vbs", "open", "", _TempFolder, SW_SHOWNORMAL, false); Printername kısmna istediğin printer ın adını yazıcan . Quote Link to comment Share on other sites More sharing options...
fba44 Posted November 2, 2013 Author Share Posted November 2, 2013 bizim konunun 4. sayfası arazi olmuş hocam. Neyse ben dll'i soracaktım halledebildiniz mi hocam ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.