Page 1 of 1 1
Topic Options
#145014 - 2005-08-08 01:15 PM Wscript.Network.SetDefaultPrinter
dhoulbrooke Offline
Lurker

Registered: 2005-08-04
Posts: 2
Hi All,

Can anyone give me any ideas as to why the below does not work.

Code:

CreateObject("WScript.Network").SetDefaultPrinter "localprintername"



I am trying to set a local printer as the default and the built-in setprinterdefault() does not seem to cover that.

Thanks in advance.

Dan

Top
#145015 - 2005-08-08 02:29 PM Re: Wscript.Network.SetDefaultPrinter
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Why do you think SetDefaultPrinter() will not set a local printer as the default?

[edit]
Just tried on a local printer to confirm and it works fine.
[/edit]


Edited by Richard H. (2005-08-08 02:31 PM)

Top
#145016 - 2005-08-08 02:36 PM Re: Wscript.Network.SetDefaultPrinter
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Probably because he is trying setprinterdefault() instead of SetDefaultPrinter().
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#145017 - 2005-08-08 03:44 PM Re: Wscript.Network.SetDefaultPrinter
dhoulbrooke Offline
Lurker

Registered: 2005-08-04
Posts: 2
Sorry that was a typo. I had been trying SetDefaultPrinter().

SetDefaultPrinter() would work for the local printer, but only after running the script a second time.

Thanks for the help. I will go back and do some more testing.

Top
#145018 - 2005-08-09 11:37 AM Re: Wscript.Network.SetDefaultPrinter
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Probably because the user's profile has not been fully loaded when your script ran. Please review the FAQ forum for ideas and solutions.
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 271 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.052 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org