Question about Vista security. I've got a script that we use for a
lot of printer administration. It relies on the prnadmin.dll
functionality from the windows resource kit tools. In order to
minimize the install time on the script I register the dll in the
script itself:

const PRNADMINPATH = "C:\Wherever\prnadmin.dll"
Dim objShell : Set objShell = CreateObject("WScript.Shell")
objShell.Run "regsvr32 /s """ & PRNADMINPATH & """",0,True

The script is only used by local administrators, so this route makes
it easy to send them a zip file and have them run the script with no
other installation. Works great in 2000/XP.

The question is, running the regsvr32 (even from start -> run) will
not work in Windows Vista since it needs to be elevated. What is the
proper Vista way of doing this type of thing? Will I need to create
an actual installation program for a script now if I want to use a
dll?

Thanks,
Jesse

Re: Vista and prnadmin.dll by Richard

Richard
Tue Apr 03 12:30:19 CDT 2007

Jesse wrote:

> Question about Vista security. I've got a script that we use for a
> lot of printer administration. It relies on the prnadmin.dll
> functionality from the windows resource kit tools. In order to
> minimize the install time on the script I register the dll in the
> script itself:
>
> const PRNADMINPATH = "C:\Wherever\prnadmin.dll"
> Dim objShell : Set objShell = CreateObject("WScript.Shell")
> objShell.Run "regsvr32 /s """ & PRNADMINPATH & """",0,True
>
> The script is only used by local administrators, so this route makes
> it easy to send them a zip file and have them run the script with no
> other installation. Works great in 2000/XP.
>
> The question is, running the regsvr32 (even from start -> run) will
> not work in Windows Vista since it needs to be elevated. What is the
> proper Vista way of doing this type of thing? Will I need to create
> an actual installation program for a script now if I want to use a
> dll?

I launch the command window with elevated privileges. Find cmd.exe, right
click, and select "Run as administrator". There may be other ways.

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--