Page 1 of 1 1
Topic Options
#203228 - 2011-10-12 05:02 PM wrapping a rundll command in script
sparkie Offline
Getting the hang of it

Registered: 2010-09-14
Posts: 92
Loc: UK
I can run this command fine from Windows > Run

rundll32 printui.dll,PrintUIEntry /y /n\\printers\printername

But I can't seem to run it in the login script

I've tried run "rundll32 printui.dll,PrintUIEntry /y /n\\printers\printer"

..and run 'rundll32 printui.dll,PrintUIEntry /y /n"\\printers\printer"'

I'm obviously missing something here

Ideas please

Top
#203229 - 2011-10-12 05:47 PM Re: wrapping a rundll command in script [Re: sparkie]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
Using Addprinter() as an example it looks like it might be that you need a space after the /n. You might consider using Shell instead. Maybe:

 Code:
shell 'rundll32 printui.dll,PrintUIEntry /y /n "\\printers\printer"'

Top
#203231 - 2011-10-12 08:29 PM Re: wrapping a rundll command in script [Re: Allen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
I can confirm that this works...

 Code:
shell 'rundll32 printui.dll,PrintUIEntry /y /n "\\printers\printer"'

Top
#203232 - 2011-10-12 08:32 PM Re: wrapping a rundll command in script [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
But also...so would...

 Code:
$nul = SetDefaultPrinter("\\printers\printer")


;\)

Top
#203233 - 2011-10-12 08:41 PM Re: wrapping a rundll command in script [Re: ShaneEP]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
As long as we're golfing...
 Code:
$=SetDefaultPrinter("\\printers\printer")

Top
#203246 - 2011-10-13 09:06 AM Re: wrapping a rundll command in script [Re: Arend_]
sparkie Offline
Getting the hang of it

Registered: 2010-09-14
Posts: 92
Loc: UK
Cheers all, I'll give those examples a go and report back. Appreciated as always. \:\)
Top
#203247 - 2011-10-13 09:17 AM Re: wrapping a rundll command in script [Re: ShaneEP]
sparkie Offline
Getting the hang of it

Registered: 2010-09-14
Posts: 92
Loc: UK
 Originally Posted By: ShaneEP
I can confirm that this works...

 Code:
shell 'rundll32 printui.dll,PrintUIEntry /y /n "\\printers\printer"'


That worked like a dream.

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
0 registered and 1538 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.057 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

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