/bundles/itninjaweb/img/Breadcrumb_cap_w.png
Hello All

Is it possible to run a desktop shortcut with admin rights in windows 7.?

The desktop shortcut is pointing to a .vbs placed in the C Drive. it have couple of msi uninstallation and instalaltion...So every time I run the shortcut, UAC window is poppingup.

Is there any script which we can add in the vbs, to run it with admin rights...
0 Comments   [ - ] Hide 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.
Answer this question or Comment on this question for clarity

Answers

0
Hi Anphi,

You can try this ,

Go to Properties of the shortcut that you have created , In Compatiblity menu you can find a option for run the program as administrator.
Answered 11/13/2011 by: mahendraKumar
Senior Yellow Belt

Please log in to comment
0
Hi Mahendra,

Thanks for the response...

I was basically looking for a script to achieve this..and I was able to achieve this using the script below..


If WScript.Arguments.Count = 0 Then
Set oShell = CreateObject("Shell.Application")
oShell.ShellExecute "wscript.exe", "path of the vbs" & " *", , "runas", 1
WScript.Quit
End If
Answered 11/14/2011 by: anphi
Orange Belt

Please log in to comment
0
Hi,

Try to add path to this vbs file in registry
"HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
Name =path_to_file
Value = "RUNASADMIN"
Answered 11/15/2011 by: Bula
Yellow Belt

Please log in to comment
0
Hi Bula,

I tried this step in couple of machines...but the shortcut is prompting for the UAC again..:(
Answered 11/18/2011 by: anphi
Orange Belt

Please log in to comment
0
Can I suggest you do some reading on UAC?
Answered 11/18/2011 by: VBScab
Red Belt

Please log in to comment