ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: set default printer according to ip address

<< < (2/2)

steeladept:
Instead of powering off, try just logging off then back in. That should provide the equivalent I believe.  Perhaps it would be possible to just add a manual rescan button to go through those steps for you?  I am assuming, of course, that this is not a new location, but an old one you are going back to.  Just a thought.  I really ought to give this a try before I continue to comment  ;D :huh:

rjbull:
Not sure it helps the OP much...  but there's a program called SDP = Select Default Printer by Edward Brophy, available here (the author's page seems to have disappeared).

What is it?

  SDP is a command line utility for setting which printer/output-device
  is to be used by default under Windows 95, 98 and NT.  It will not run
  under Windows 3.1.

Why did I make it?

  I had to make print outs every morning automatically using task scheduling
  software using NotePad & WordPad using the little know /p command line
  option.  (aside:  NotepPad /p SDP.TXT automatically loads, prints, and
  closes this doc.)  However, if someone sent a fax or something the previous
  day, the print outs would go to the fax instead of the printer.  I needed
  A utility that would make the printer the default output every morning. 
  I created SDP and I set my scheduling software to run it before the morning
  print outs and... guess what?  No more problems.

How do you use it?

  The basic usage is:  SDP.EXE <printer description>
 
  Just type in all or part of the printer's name and/or port and SDP will
  select the first device that it matches.  The printer description is
  CASE SENSITIVE!  Epson is not the same as EPSON to SDP.  You should run
  SDP without parameters to see the case used.  Also do no use quotes or
  chevrons (< >) on the command line, just what it asks for. 

  Example:  SDP.EXE Okidata

  Running SDP without parameters gives you the help screen that shows which
  printers are installed (i.e. selectable) and their complete, case sensitive
  description.  It displays the printer's name and port separated by a comma.
  You can enter this entire description as shown or any part of it.  If
  the printer description was:  HP LaserJet 4P,\\network\hp you could
  enter:  SDP.EXE 4P,\\net and SDP would find it.
 
  SDP can be run from a DOS window, a DOS batch file, the Run command on the
  Start Menu or you can create a shortcut with the <printer description>
  after the program's name.  From a DOS batch file, it's a good idea to use
  the START command with the /w wait option.
--- End quote ---

wr975:
Here is a very, very, very basic Autohotkey script. It checks every ten seconds for the current ip and changes the default printer. If it's more like the solution you're looking for, feel free to enhance it!

Documentation about printui.dll can be found here: http://www.microsoft.com/windowsserver2003/techinfo/overview/printuidll.mspx


--- ---
#NoEnv
#persistent
#SingleInstance force
;#NoTrayIcon

SetTimer,Check,10000
Gosub,Check
return

Check:
if A_IPAddress1 = %OldIP%
Return

If A_IPAddress1 = 192.168.1.238
run,rundll32 printui.dll`,PrintUIEntry /y /n\\PCNV\PDFCreator

If A_IPAddress1 = 192.168.1.2
run,rundll32 printui.dll`,PrintUIEntry /y /n\\Machine2\Printer2

If A_IPAddress1 = 192.168.1.3
run,rundll32 printui.dll`,PrintUIEntry /y /n\\Machine3\Printer3

If A_IPAddress1 = 192.168.1.4
run,rundll32 printui.dll`,PrintUIEntry /y /n\\Machine4\Printer4

TrayTip,Default printer changed

OldIP := A_IPAddress1

Return

techidave:
I did find this printer switcher but it is no longer under development and only allows for 2 printers.

http://abednarz.net/wp/beds-printer-switcher/

Navigation

[0] Message Index

[*] Previous page

Go to full version