//flex table opened by JP

Click to See Complete Forum and Search --> : windows 2000


r8500
03-12-2003, 02:11 PM
Hey, heres an odd question, that I am sure no one has ever asked before.

I am running win 2000 on a laptop with a docking station. Is there anyway to make the default printer automatically switch when the laptop is docked, or undocked?

rraehal
03-12-2003, 02:48 PM
I am not sure if you can do that. I have only enabled and disabled hardware that shows in device manager. I have never done printers. I am sure you may be able to write some sort of script that could do this.

Here is the basics for batch call:
Create a text file with the following info:

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Xerox300"
WshNetwork.SetDefaultPrinter "\\PrintServer1\Xerox300"

Save the text file with a .vbs extension.
Call the vbs script from a batch file at logon.

I am not sure not to determine if you are docked or not. Maybe add somethin like

Set WshNetwork = CreateObject("WScript.Network")
if docked
WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Xerox300"
WshNetwork.SetDefaultPrinter "\\PrintServer1\Xerox300"
end if
if undocked
WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Xerox300"
WshNetwork.SetDefaultPrinter "\\PrintServer1\Xerox300"
end if

Sorry i do not know the commands for docking.

BipolarBill
03-12-2003, 07:37 PM
You can create separate hardware profiles:

http://www.microsoft.com/windows2000/en/professional/help/default.asp?url=/windows2000/en/professional/help/hardware_profiles_overview.htm

r8500
03-12-2003, 10:53 PM
Originally posted by BipolarBill
You can create separate hardware profiles:

http://www.microsoft.com/windows2000/en/professional/help/default.asp?url=/windows2000/en/professional/help/hardware_profiles_overview.htm

I dont think that works with printers though.