I have to register an .ocx file which gets registered only when it has admin priviliges.

So i used below script
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\ISIS")
Set objFolderItem = objFolder.ParseName("test.cmd")
objFolderItem.InvokeVerb "runas"


Using the above script but at the end it prompts the window where I have to click Yes, can we suppress that as well.
Is there any other way to get it done.

Please suggest.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
ORIGINAL: shweta_kar
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\ISIS")
Set objFolderItem = objFolder.ParseName("test.cmd")
objFolderItem.InvokeVerb "runas"

Using the above script but at the end it prompts the window where I have to click Yes, can we suppress that as well.

I believe, using the above code : you only make the the cmd to run as admin, the UAC would still prompt. To add, 'Run As' to the vbscript, you can include reg settings like
HKEY_CLASSES_ROOT\VBSFile\Shell\runas.
Are you using this script inside msi?
Answered 12/08/2011 by: SandeepPanat
Orange Senior Belt

Please log in to comment
0
The whole purpose of UAC is that it can't be bypassed, otherwise it would be copletely useless. If you wrap what you have into an MSI and deploy via GPO or whatever you are using for mass distribution, you might be able to get passed it. If your running it manually or with an exe, you are going to have a much harder time.
Answered 12/08/2011 by: jmaclaurin
Third Degree Blue Belt

Please log in to comment
0
Server: Windows 2008 R2 Standard SP1
Distribution Method: SCCM 2007
Workstations: Windows 7 Enterprise x86 and x64

I'm attempting to utilize SCCM for distribution to Windows 7 machines, but it doesn't seem to matter what I push to them. If it's at all executable, then UAC stops it. I've tried .BAT, .CMD, .EXE, .VBS, and every combination of those (one launching another, etc.). Sure there are utilities you can find out there that sneak your executable around UAC, but I want to be able to use the proper tools (DP) and nothing more. There has to be an easier way to do this. Am I just out of luck with this one?
Answered 03/14/2012 by: stmasi
Senior Yellow Belt

Please log in to comment
0
we are distributing packages with sccm 2007 and never had problems with UAC.

in sccm, make sure that your packages are set to install as local system account and you should be good!

in sccm, go to your program, open the property window, navigate to Environment tab and make sure that "Run with administrative rights" is checked.
Answered 03/14/2012 by: kardock
Second Degree Green Belt

Please log in to comment
Answer this question or Comment on this question for clarity