[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Print the status page with a script

Posted on 2007-07-28
62
Medium Priority
?
770 Views
Last Modified: 2012-06-27
Hi,

I have to take a print out of the status page every day.Is there a way i can print the status page of all the printers with a bat file.

Regards
Sharath
0
Comment
Question by:bsharath
  • 34
  • 24
  • 2
  • +1
62 Comments
 
LVL 29

Expert Comment

by:Alan Huseyin Kayahan
ID: 19587697
      Hi Sharath

<SCRIPT LANGUAGE = "VBScript">
Sub window_onLoad
 GetInfo
 iTimerID = window.setInterval("GetInfo", 60000, "VBScript")
End Sub
Sub GetInfo
 For i = (objTable.Rows.Length - 1) to 0 Step -1
 myNewRow = Document.All.objTable.deleteRow(i)
 Next
 Set objRow = objTableBody.InsertRow()
 objRow.Style.fontWeight = "bold"
 Set objCell = objRow.InsertCell()
 objCell.InnerText = "Name"
 Set objCell = objRow.InsertCell()
 objCell.InnerText = "Location"
 Set objCell = objRow.InsertCell()
 objCell.InnerText = "Status"
 strComputer = "."
 Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & _
 strComputer & "\root\cimv2")
 Set colPrinters = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_Printer")
 For Each objPrinter in colPrinters
 Set objRow = objTableBody.InsertRow()
 Set objCell = objRow.InsertCell()
 objCell.InnerText = objPrinter.Name
 Set objCell = objRow.InsertCell()
 objCell.InnerText = objPrinter.Location
 Set objCell = objRow.InsertCell()
 Select Case objPrinter.PrinterStatus
 Case 1
 strPrinterStatus = "Other"
 Case 2
 strPrinterStatus = "Unknown"
 Case 3
 strPrinterStatus = "Idle"
 Case 4
 strPrinterStatus = "Printing"
 Case 5
 strPrinterStatus = "Warming up"
 End Select
 objCell.InnerText = strPrinterStatus
 Next
End Sub
</SCRIPT>
<TABLE ID = "objTable" border = "1" >
<TBODY ID = "objTableBody">
</TBODY>
</TABLE>

Regards
0
 
LVL 11

Author Comment

by:bsharath
ID: 19587704
I get this error.

---------------------------
Windows Script Host
---------------------------
Script:      C:\Printer status page.vbs
Line:      46
Char:      1
Error:      Expected statement
Code:      800A0400
Source:       Microsoft VBScript compilation error

---------------------------
OK  
---------------------------
0
 
LVL 29

Expert Comment

by:Alan Huseyin Kayahan
ID: 19587706
         Above script is for viewing in web page. Any time you doubkle-click it, you can view the status of all, then ctrl+p to print
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 19588107
Apply Following commands and post results.
Also confirm me does it show any dialog box or prints the page directly.

Click Start -> Run -> Cmd.exe
WMIC Printer "PrinterName" Call PrintTestPage
                               ^---------------------------------------- put the printer name here.




0
 
LVL 11

Author Comment

by:bsharath
ID: 19588267
I get this.

C:\>WMIC Printer "HC-2F" Call PrintTestPage
No Instance(s) Available.
What i want is the status page not test page.I want to get the pagecount page for filing them.
0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 19588832
Sorry mate, I don't think this can be done easily with a script (or at least not in my knowledge). If the printers are HTTP enabled then you can get the statistics/ page count report through web browser (http://PrinterIPAddress) or visit printers vendor site for such software.
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19590621
Hi bsarath,

Pretty near everything for printer ability via scripting is here.

http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/printing/servers/

However I agree with farankazi, in that Im pretty sure you can not get the printers page count/statistics directly via a script.


I would say tho that If these are in fact jetdirect printers that you can access via a browser I see no reason why you couldnt script a web request to the printer and then parse the resulting page/data you need from what is returned.



zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19590639
Maybe way off the deep end, but the thought of a packet capture during the HP status moniter server side and see what the request for update to the printer looks like is not completly out of order here either.  But am siding with parsing an http request.  I would try it out but no jetdirect printers here.  If its still open for the next few days Ill try to put something together at work with the http parsing.



zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19614481
Any help....
0
 
LVL 11

Author Comment

by:bsharath
ID: 19644377
Any help....
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19644387
Hi bsharath, are these jetdirect network printers?

I have just finished a script that will remotely query a jetdirect printer and save the status page returned to an html file on the local machine the script is run from.  If these are jetdirect printers this should work for you.

zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19644419
zoofan

i dont know if they are jet direct printers.How do i find it.
They are network printers and i have a windows 2003 print server.
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19644429
Open a web browser and type in the IP address of one of the printers, If they are jetdirect and open you should be able to see the HP status page.

http://192.168.0.254    <--- replace with printer IP.


zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19644446
If you dont know the IP and it is infact netowrked,  go into your printers properties and look at the ports tab.  the ip for the port will be there.

zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19644596
with the ip address i am able to see the status page of the printer.

I chedck all my 20 printers i am able to see the web page
0
 
LVL 11

Author Comment

by:bsharath
ID: 19644600
A way to print all the printers status page to 1 printer near me...?
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19644609
k,  this will save a status page 192_168_0_1.html to your local hdd, that done.  Give me a few and Ill see if I can get it auto print to your default printer as well.

zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19644739
Ok thanks waiting for this script.This will save 30 min every day for 1 Engineer to pick each status page from each printer.....
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19644775
Copy and paste into printstatus.vbs  and run with printer IP as parameter.

Filename         space   IPaddress
printstatus.vbs 192.168.0.0


'===Start copy: printstatus.vbs===
' ---------------------------------------------------------------'
' printstatus.vbs
' 'Sample VBScript to query remote printer
' 'and retieve/print status page.
' ''Author Riley C. aka ZooFan
' '''Version 4.1 - August 2007
' ''''www.experts-exchange.com question ID: 22726732
' ---------------------------------------------------------------'
'
Option Explicit      
      Const ForReading = 1, ForWriting = 2, ForAppending = 3 'FileObject Access Type
      Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 'FileObject Format Type
      Const SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
      Dim sCurPath 'Current Path of Script
      Dim strTempFile 'Name of temp file created and deleted by script
      Dim objWshShell 'Create object for Scripting Shell
      Dim objFso ' Create file system Object for WScript
      Dim strGetPage 'The page we want from the web
      Dim objIndexPage 'Object for reading
      Dim objReadIndex 'Object for reading
      Dim intLneCount '
      Dim strFilesaved 'The page returned from the GET
      Dim strArgReplace
      Dim strCommand
'Set up Common Objects
      Set objFso = CreateObject("Scripting.FileSystemObject")
      Set objWshShell = WScript.CreateObject("WScript.Shell")
     
'Set Variables
      sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
      strGetPage = "http://" & WScript.Arguments(0)
      strArgReplace = Replace(WScript.Arguments(0),".","_")
      strTempFile = sCurPath & "\" &  strArgReplace &".html"
      strCommand = "RUNDLL32.EXE MSHTML.DLL,PrintHTML " & strTempFile
'Test to see if our temp file exists if so delete it
      If objFso.FileExists(strTempFile) Then
            objFso.deleteFile(strTempFile)
      End If
'Get the file from the site
Call GetPage(strGetPage, strTempFile)
'Read the file into Array
            Set objIndexPage = objFso.GetFile(strTempFile)
            Set objReadIndex = objIndexPage.OpenAsTextStream(ForReading, TristateUseDefault)
                  Do Until objReadIndex.AtEndOfStream
                        ReDim Preserve arrRegValues(intLneCount)
                        arrRegValues(intLneCount) = objReadIndex.ReadLine
                        intLneCount = intLneCount + 1
                  Loop
            objReadIndex.Close
            objWshShell.Run strCommand, 0, True
            objFso.DeleteFile(strTempFile)
            Wscript.Quit
Function  GetPage(address, strFilesaved)
Dim DataBin
Dim HTTPGET
Dim server
Set HTTPGET = CreateObject("Msxml2.ServerXMLHTTP.6.0")
HTTPGET.setOption(2) = SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS
HTTPGET.Open "GET", address, False
HTTPGET.Send
DataBin = HTTPGET.ResponseBody
Const adTypeBinary=1
Const adSaveCreateOverWrite=2
Dim SendBinary
Set SendBinary = CreateObject("ADODB.Stream")
SendBinary.Type = adTypeBinary
SendBinary.Open
SendBinary.Write DataBin
SendBinary.SaveToFile strFilesaved, adSaveCreateOverWrite
End Function
Wscript.Quit      
'==END COPY==


let me know if you any trouble.

zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19644779
Oh,  depending on your OS you may need to install Windows Installer V3 for the XML6

http://www.microsoft.com/downloads/details.aspx?familyid=889482FC-5F56-4A38-B838-DE776FD4138C&displaylang=en




zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19644818
I am running this from Win 2003.I get no error nor any results.Am i missing any thing.

0
 
LVL 12

Expert Comment

by:zoofan
ID: 19644825
hmmm,  you are using teh printer ip in the command line correct?

try this as it may be a printing issue.


'===Start copy: printstatus.vbs===
' ---------------------------------------------------------------'
' printstatus.vbs
' 'Sample VBScript to query remote printer
' 'and retieve/print status page.
' ''Author Riley C. aka ZooFan
' '''Version 4.1 - August 2007
' ''''www.experts-exchange.com question ID: 22726732
' ---------------------------------------------------------------'
'
Option Explicit      
      Const ForReading = 1, ForWriting = 2, ForAppending = 3 'FileObject Access Type
      Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 'FileObject Format Type
      Const SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
      Dim sCurPath 'Current Path of Script
      Dim strTempFile 'Name of temp file created and deleted by script
      Dim objWshShell 'Create object for Scripting Shell
      Dim objFso ' Create file system Object for WScript
      Dim strGetPage 'The page we want from the web
      Dim objIndexPage 'Object for reading
      Dim objReadIndex 'Object for reading
      Dim intLneCount '
      Dim strFilesaved 'The page returned from the GET
      Dim strArgReplace
      Dim strCommand
'Set up Common Objects
      Set objFso = CreateObject("Scripting.FileSystemObject")
      Set objWshShell = WScript.CreateObject("WScript.Shell")
     
'Set Variables
      sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
      strGetPage = "http://" & WScript.Arguments(0)
      strArgReplace = Replace(WScript.Arguments(0),".","_")
      strTempFile = sCurPath & "\" &  strArgReplace &".html"
      strCommand = "RUNDLL32.EXE MSHTML.DLL,PrintHTML " & strTempFile
'Test to see if our temp file exists if so delete it
      If objFso.FileExists(strTempFile) Then
            objFso.deleteFile(strTempFile)
      End If
'Get the file from the site
Call GetPage(strGetPage, strTempFile)
'Read the file into Array
            Set objIndexPage = objFso.GetFile(strTempFile)
            Set objReadIndex = objIndexPage.OpenAsTextStream(ForReading, TristateUseDefault)
                  Do Until objReadIndex.AtEndOfStream
                        ReDim Preserve arrRegValues(intLneCount)
                        arrRegValues(intLneCount) = objReadIndex.ReadLine
                        intLneCount = intLneCount + 1
                  Loop
            objReadIndex.Close
            objWshShell.Run strCommand, 0, True
            Wscript.Quit
Function  GetPage(address, strFilesaved)
Dim DataBin
Dim HTTPGET
Dim server
Set HTTPGET = CreateObject("Msxml2.ServerXMLHTTP.6.0")
HTTPGET.setOption(2) = SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS
HTTPGET.Open "GET", address, False
HTTPGET.Send
DataBin = HTTPGET.ResponseBody
Const adTypeBinary=1
Const adSaveCreateOverWrite=2
Dim SendBinary
Set SendBinary = CreateObject("ADODB.Stream")
SendBinary.Type = adTypeBinary
SendBinary.Open
SendBinary.Write DataBin
SendBinary.SaveToFile strFilesaved, adSaveCreateOverWrite
End Function
Wscript.Quit      
'==END COPY==


after you run it look in the directory where you have the script and tell me if you see the html file.

zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19644968
Does the second script save the html file?  The first one deletes it after printing I removed the delete line as I think it is just a print issue.


zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645094
Ok I figured out what was wrong, will repost in a sec.

zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645106
Was hidding the shell out so it wouldnt open the print dialog box :-( sorry!!

'===Start copy: printstatus.vbs===
' ---------------------------------------------------------------'
' printstatus.vbs
' 'Sample VBScript to query remote printer
' 'and retieve/print status page.
' ''Author Riley C. aka ZooFan
' '''Version 4.3 - August 2007
' ''''www.experts-exchange.com question ID: 22726732
' ---------------------------------------------------------------'
'
Option Explicit      
      Const ForReading = 1, ForWriting = 2, ForAppending = 3 'FileObject Access Type
      Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 'FileObject Format Type
      Const SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
      Dim sCurPath 'Current Path of Script
      Dim strTempFile 'Name of temp file created and deleted by script
      Dim objWshShell 'Create object for Scripting Shell
      Dim objFso ' Create file system Object for WScript
      Dim strGetPage 'The page we want from the web
      Dim objIndexPage 'Object for reading
      Dim objReadIndex 'Object for reading
      Dim intLneCount '
      Dim strFilesaved 'The page returned from the GET
      Dim strArgReplace
      Dim strCommand
'Set up Common Objects
      Set objFso = CreateObject("Scripting.FileSystemObject")
      Set objWshShell = WScript.CreateObject("WScript.Shell")
     
'Set Variables
      sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
      strGetPage = "http://" & WScript.Arguments(0)
      strArgReplace = Replace(WScript.Arguments(0),".","_")
      strTempFile = sCurPath & "\" &  strArgReplace &".html"
      strCommand = "RUNDLL32.EXE MSHTML.DLL,PrintHTML " & strTempFile
'Test to see if our temp file exists if so delete it
      If objFso.FileExists(strTempFile) Then
            objFso.deleteFile(strTempFile)
      End If
'Get the file from the site
Call GetPage(strGetPage, strTempFile)
'Read the file into Array
            Set objIndexPage = objFso.GetFile(strTempFile)
            Set objReadIndex = objIndexPage.OpenAsTextStream(ForReading, TristateUseDefault)
                  Do Until objReadIndex.AtEndOfStream
                        ReDim Preserve arrRegValues(intLneCount)
                        arrRegValues(intLneCount) = objReadIndex.ReadLine
                        intLneCount = intLneCount + 1
                  Loop
            objReadIndex.Close
            objWshShell.Run strCommand,1,true
            Wscript.Quit
Function  GetPage(address, strFilesaved)
Dim DataBin
Dim HTTPGET
Dim server
Set HTTPGET = CreateObject("Msxml2.ServerXMLHTTP")
HTTPGET.setOption(2) = SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS
HTTPGET.Open "GET", address, False
HTTPGET.Send
DataBin = HTTPGET.ResponseBody
Const adTypeBinary=1
Const adSaveCreateOverWrite=2
Dim SendBinary
Set SendBinary = CreateObject("ADODB.Stream")
SendBinary.Type = adTypeBinary
SendBinary.Open
SendBinary.Write DataBin
SendBinary.SaveToFile strFilesaved, adSaveCreateOverWrite
End Function
Wscript.Quit      
'==END COPY==
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645204
Found another typo,  sorry must be time for sleep.......


'===Start copy: printstatus.vbs===
' ---------------------------------------------------------------'
' printstatus.vbs
' 'Sample VBScript to query remote printer
' 'and retieve/print status page.
' ''Author Riley C. aka ZooFan
' '''Version 4.3 - August 2007
' ''''www.experts-exchange.com question ID: 22726732
' ---------------------------------------------------------------'
'
Option Explicit      
      Const ForReading = 1, ForWriting = 2, ForAppending = 3 'FileObject Access Type
      Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 'FileObject Format Type
      Const SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
      Dim sCurPath 'Current Path of Script
      Dim strTempFile 'Name of temp file created and deleted by script
      Dim objWshShell 'Create object for Scripting Shell
      Dim objFso ' Create file system Object for WScript
      Dim strGetPage 'The page we want from the web
      Dim objIndexPage 'Object for reading
      Dim objReadIndex 'Object for reading
      Dim intLneCount '
      Dim strFilesaved 'The page returned from the GET
      Dim strArgReplace
      Dim strCommand
'Set up Common Objects
      Set objFso = CreateObject("Scripting.FileSystemObject")
      Set objWshShell = WScript.CreateObject("WScript.Shell")
     
'Set Variables
      sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
      strGetPage = "http://" & WScript.Arguments(0)
      strArgReplace = Replace(WScript.Arguments(0),".","_")
      strTempFile = sCurPath & "\" &  strArgReplace &".html"
      strCommand = "RUNDLL32.EXE MSHTML.DLL,PrintHTML " & strTempFile
'Test to see if our temp file exists if so delete it
      If objFso.FileExists(strTempFile) Then
            objFso.deleteFile(strTempFile)
      End If
'Get the file from the site
Call GetPage(strGetPage, strTempFile)
'Read the file into Array
            Set objIndexPage = objFso.GetFile(strTempFile)
            Set objReadIndex = objIndexPage.OpenAsTextStream(ForReading, TristateUseDefault)
                  Do Until objReadIndex.AtEndOfStream
                        ReDim Preserve arrRegValues(intLneCount)
                        arrRegValues(intLneCount) = objReadIndex.ReadLine
                        intLneCount = intLneCount + 1
                  Loop
            objReadIndex.Close
            objWshShell.Run strCommand,1,true
            objFso.DeleteFile(strTempFile)
            Wscript.Quit
Function  GetPage(address, strFilesaved)
Dim DataBin
Dim HTTPGET
Dim server
Set HTTPGET = CreateObject("Msxml2.ServerXMLHTTP.6.0")
HTTPGET.setOption(2) = SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS
HTTPGET.Open "GET", address, False
HTTPGET.Send
DataBin = HTTPGET.ResponseBody
Const adTypeBinary=1
Const adSaveCreateOverWrite=2
Dim SendBinary
Set SendBinary = CreateObject("ADODB.Stream")
SendBinary.Type = adTypeBinary
SendBinary.Open
SendBinary.Write DataBin
SendBinary.SaveToFile strFilesaved, adSaveCreateOverWrite
End Function
Wscript.Quit      
'==END COPY==



zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19645461
What will happen when i run this.
Script name ip address.?
Will it save a file or print to the printer.
Should i specify the printer it needs to print all the status pages?
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645499
it will print them, and should ask you for the printer to print to.  It will delete the temp file after the print.  If you have problems printing or want to keep the files add a ' and comment out the

   objFso.DeleteFile(strTempFile)

line then it will not delete the files and just leave them in the directory the script is in.


zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645511
each file will be named by printer IP

192_158_0_0.html


zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19645557
There are 2 lines in the script
objFso.DeleteFile(strTempFile)
I commented both .There is a html file which is created but .There is no contents in it.....
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645591
sorry only the second should be commented out

            objWshShell.Run strCommand,1,true
            'objFso.DeleteFile(strTempFile)
            Wscript.Quit


this one.


zd
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645603
did you have to enter a password when you opened the printer ip ina browser?


zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19645688
No it never asked me for a password.
It just opened blank
0
 
LVL 11

Author Comment

by:bsharath
ID: 19645707
I get this.

 Internet Explorer cannot display the webpage
   
   Most likely causes:
You are not connected to the Internet.
The website is encountering problems.
There might be a typing error in the address.
 
   What you can try:
     Check your Internet connection. Try visiting another website to make sure you are connected.  
 
     Retype the address.  
 
     Go back to the previous page.
 
     More information

This problem can be caused by a variety of issues, including:

Internet connectivity has been lost.
The website is temporarily unavailable.
The Domain Name Server (DNS) is not reachable.
The Domain Name Server (DNS) does not have a listing for the website's domain.
If this is an HTTPS (secure) address, click tools, click Internet Options, click Advanced, and check to be sure the SSL and TLS protocols are enabled under the security section.

For offline users

You can still view subscribed feeds and some recently viewed webpages.
To view subscribed feeds

Click the Favorites Center button , click Feeds, and then click the feed you want to view.

To view recently visited webpages (might not work on all pages)

Click Tools , and then click Work Offline.
Click the Favorites Center button , click History, and then click the page you want to view.

 
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645716
when you put the ip pf the printer in a browser you get a blank page?

Im not talking about the file,  nor with the password,  am talking about directly connecting to the printer


zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645745
your post "with the ip address i am able to see the status page of the printer.

I chedck all my 20 printers i am able to see the web page"


did you enter a password to view this?


zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19645771
When i put this ip on the ie
http://129.40.185.54/

I can see the ststus page of that printer without any password.It just opens....
0
 
LVL 11

Author Comment

by:bsharath
ID: 19645784
No i never put any password.It just opens...
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645793
ok and when you pass the ip to the script your doing it as IP only correct>?

no http://


just  129.40.185.54

zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645818
and no chance you saved this password on an earlier access?


this worked on all 9 of my HP's 4000-8100  without issue.  so not really sure whats up


zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19645849
Yes i am specifing only the ip address no Http

I checked with many printer all the printers just create a file but no content in it...
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19645896
Have to goto work will recheck it again and get back with you a bit


zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19645910
Ok thanks
0
 
LVL 11

Author Comment

by:bsharath
ID: 19646052
WHEN I TRIED SCRIPTNAME  WITH HTTP:\\IPADDRESS I GOT THIS.

---------------------------
Windows Script Host
---------------------------
Script:      C:\printstatus.vbs
Line:      61
Char:      1
Error:      A connection with the server could not be established

Code:      80072EFD
Source:       msxml6.dll

---------------------------
OK  
---------------------------
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19648550
Hi, the http is added in the script, made it easier to deal with the file name.  So when you add it in the parameter what your connecting to becomes http://http://ipaddress.   hence the error.  What type of printers do you have?  I tested this on a hp inkjet that is networked and found that the status page is all java and resulted in a blank page saved.

zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19649164
Retested @ work on a HP4050 and it returned a blank page.  The status page on that printer is a java script result so Im thinking this maybe whats happening on your end.  Now that I have one returning the same results you have I will rework this and try to resolve it.  Back later.

zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19650018
Have uploaded a VB project with source files and compiled exe,  vbscripting does not support printing web pages in any sort of reasonable fashion.  Nor can it deal with the frame pages.  Try this out and let me know.

Modify the printers.txt and put your printer ips in the list(take mine out) run the app and click "autorun"

https://filedb.experts-exchange.com/incoming/ee-stuff/4285-printstatus.zip

zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19651118
zoofan

This is  excellent stuff. When i give a load and print .Where will it print?. Will it print all in 1 printer.Small change can you make the screen which is being shown as big as possible to fit screen.
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19651275
It will print to your windows default printer, and yes all will print to the same.  Will make it larger gimmie a few minutes.

zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19651311
Can i given give the prints to the relevent printers.Some time i would require to give it to the related printers.An button which can do this please...
0
 
LVL 11

Author Comment

by:bsharath
ID: 19651331
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19651347
I am not understanding this at all
"Can i given give the prints to the relevent printers.Some time i would require to give it to the related printers.An button which can do this please..."


and no I have not worked on
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Q_22731874.html
  yet have been very busy with work the last week.


Is a bit of a tall order for a single question, no?



zf
0
 
LVL 12

Accepted Solution

by:
zoofan earned 2000 total points
ID: 19651366
I have updated the project and recomplied a new exe for you,  all source included.  The browser control will autoresize with the window size.

https://filedb.experts-exchange.com/incoming/ee-stuff/4288-printstatus.zip


zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19651372
Sorry.

"Can i given give the prints to the relevent printers.Some time i would require to give it to the related printers.An button which can do this please..."


What i mean is you have made the script in such a way that all the prints of the status page comes to one printer.If possible can i even have a option to give individual prints to the individual printers as some time i would need to check the printer quality....


And regarding this Q.

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Q_22731874.html

Please help when ever possible with the possible points covered please....

0
 
LVL 11

Author Comment

by:bsharath
ID: 19651428
An error has occured in the script on this page

Line 1829
char  1
error  unspecified error.

When i give a auto run all i get the above error...
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19651501
That error is being generated by the printer not the app, first off this isnt a script, it is, second there isnt 1829 lines of code in it :-)  but there is in the status page.  Only thign that changed between first project and second project is the resize of the browser control period.  If that occurs when you first click autorun, remove the first or second printer from your text file and retry.


There is no way that I am aware of for this app to print to a printer that you do not have installed,  It is possiable to script a test page to any printers that are installed and shared on a print server(windows pc, NOT jetdirect) but a list of all share names is required.  That is not what this app was written to do tho and a different process all together.

zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19651524
Am testing this to see if I can get it incorperated into the app,  uses telnet to send a page to a remote printer via tcp/ip

Telnet can be used to transfer data to the HP Jetdirect device. This should be used only for testing since it is not an HP-supported method of printing. Telnet porting may differ in the variety of operating systems that include telnet as an application. One of the following examples should work:

    *

      telnet TCP/IP address 9100 < filename

    *

      cat filename | telnet TCP/IP address 9100

    *

      telnet TCP/IP address 9100

Then type something and end the telnet session; what was typed should print

type a CTRL ] to end the telnet connection, and then type "quit" to end telnet. Another way to terminate the telnet connection is CTRL Z. If you are using a text file for a test, the control characters CTRL M, and then CTRL ] can be appended to the end of the text file. This will end the telnet session, as well as the 9100 socket connection


Ill let ya know.

zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19651527
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19651540
Oh the script to print the test page to a PC based print server

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colPrinters =  objWMIService.ExecQuery _
    ("Select * from Win32_Printer Where DeviceID = '\\\\atl-ps-01\\color-printer'")

For Each objPrinter in colPrinters
    errReturn = objPrinter.PrintTestPage
    If errReturn = 0 Then
        Wscript.Echo "The test page was printed successfully."
    Else
        Wscript.Echo "The test page could not be printed."
    End If
Next


From  http://www.microsoft.com/technet/scriptcenter/resources/qanda/apr05/hey0407.mspx




zf
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19651550
If you would like some help modifing that to work with a text file list of print server shares post it.

zf
0
 
LVL 11

Author Comment

by:bsharath
ID: 19651563
zoofan

i use this way to print multiple test pages on its individual printers.

rundll32 printui.dll,PrintUIEntry /k /n "\\dev-chen-srv10\Hc-GF"
rundll32 printui.dll,PrintUIEntry /k /n "\\dev-chen-srv10\Hc-1F"
rundll32 printui.dll,PrintUIEntry /k /n "\\dev-chen-srv10\Hc-2F"
rundll32 printui.dll,PrintUIEntry /k /n "\\dev-chen-srv10\Hc-3F"
rundll32 printui.dll,PrintUIEntry /k /n "\\dev-chen-srv10\Hc-4F"
0
 
LVL 12

Expert Comment

by:zoofan
ID: 19651573
ok cool.

zf
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Know what services you can and cannot, should and should not combine on your server.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question