/build/static/layout/Breadcrumb_cap_w.png

to run a desktop shortcut with admin rights

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   [ + ] Show comments

Answers (5)

Posted by: mahendraKumar 13 years ago
Senior Yellow Belt
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.
Posted by: anphi 13 years ago
Orange Belt
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
Posted by: Bula 13 years ago
Yellow Belt
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"
Posted by: anphi 13 years ago
Orange Belt
0
Hi Bula,

I tried this step in couple of machines...but the shortcut is prompting for the UAC again..:(
Posted by: anonymous_9363 13 years ago
Red Belt
0
Can I suggest you do some reading on UAC?
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ