Jump to content

Bring up "Printing Defaults"


 Share

Recommended Posts

I am making an install script for installing printers without having to reboot, I have been successful so far except when I try to configure the printer driver.

I can use...

'rundll32 printui.dll,PrintUIEntry /e /n "printername"'

To bring up printing preferences but I have searched the internet for find a command to bring up "printer defaults" normally found in the advance tab and found nothing. This is necessary for other computers trying to access this printer.

I have also tried to import printer settings via

"RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n " & """" & $drivername & """" & " /a " & """" & @TempDir & "\TSC TDP-247.dat" & """"

But there are issues making this work with 64bit computing, mostly the “.dat” is not interchangeable from different 64bit systems.

Anyway, How do I get to “Printing defaults” via CMD? Or is there some other way to set printer defaults automaticly?

No problem can withstand the assault of sustained thinking.Voltaire

_Array2HTMLTable()_IEClassNameGetCollection()_IEquerySelectorAll()

Link to comment
Share on other sites

  • 5 weeks later...
  • 4 weeks later...

Actually I did find a way to solve my problem but not necessarily they way I though.

My originaly solution was to focuse to the tab and do a control send to move to the right tab. You will notice this fuction will break in windows vista and up if the tabs have more than one level (in other words if you have to move to a tab thats up or down and over). But now I have a way to simply jump to the right tab.

I still use RUNDLL32 PRINTUI.DLL,PrintUIEntry to bring up printer properties but instead of using a control send I used a new command that in the beta called...

_GUICtrlTab_FindTab

_GUICtrlTab_ClickTab

_GUICtrlTab_GetCurSel

And used it in this fuction. This is not my handy work tho and I dont remeber the person who made this fuction but I think he was a monitor here.

Func _SetwinTab($sTitle, $tabname)
;This only workd for windows tabs
WinWait($sTitle, "", 10)
$hWnd = WinGetHandle($sTitle)
If @error Then _Exitonerror("Failed to open " & $sTitle & " window.")
WinActivate($hWnd)
Sleep(100)
; Get handle to Tab control
$hTab = ControlGetHandle($hWnd, "", "SysTabControl321")
If @error Then _Exitonerror("Failed to get handle to TAB control.")
; Find and select Advanced tab
$iAdvTab = _GUICtrlTab_FindTab($hTab, $tabname)
If $iAdvTab = -1 Then _Exitonerror("Failed to find " & $tabname & " tab.")
_GUICtrlTab_ClickTab($hTab, $iAdvTab)
If _GUICtrlTab_GetCurSel($hTab) <> $iAdvTab Then _Exitonerror("Failed to change selected tab to " & $tabname & ".")
EndFunc ;==>_SetwinTab

Thanks nameless solider on the battle field of coding. :P

No problem can withstand the assault of sustained thinking.Voltaire

_Array2HTMLTable()_IEClassNameGetCollection()_IEquerySelectorAll()

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...