Get 'Run as administrator' for .log files in context menu

Joined
Jan 3, 2010
Messages
101
Reaction score
2
I have not been able to find a general method for adding 'Run as administrator' in Windows 7 context menu. I need it specifically for .log files now, but would like to have a generic method (if such exists) for any file.

Help would be appreciated.

Hans L
 

TrainableMan

^ The World's First ^
Moderator
Joined
May 10, 2010
Messages
9,353
Reaction score
1,587
A log file is not an executable so you aren't "running" it at all, as an administrator or otherwise. What you are doing is using a file association to run a program known to support .log file extensions. Therefore you would need to find the actual program that you trigger & right-click on it & set it to "always run as an administrator". But why you would do that I don't know because I can't think of any reason you should need to be an admin to look at a log file; it is simply a txt file and is probably just opening with Notepad.exe.
 
Joined
Jan 3, 2010
Messages
101
Reaction score
2
I understand. No "run" in this case.

This log file was produced when I run scannow, and it is C:\Windows\Logs\CBS\CBS.log. When I try to open it (with Notepad), I get "Access is denied". I guess this happens seldom enough so that I can open Notepad and set it to run as admin and then open the file in question. However, it would be better if Notepad runs as admin always (which you said above), in which case I can doubleclick on this log file and it would open. However, then I right-click on Notepad.exe, I do not see "Always run as an administrator". How can I get that in the context menu?

Hans L
 

TrainableMan

^ The World's First ^
Moderator
Joined
May 10, 2010
Messages
9,353
Reaction score
1,587
The best option I can offer is a "send to" shortcut.

Open Windows Explorer (not Internet Explorer).
In the folder bar type shell:sendto & press <enter>
It should take you to C:\Users\<YourUserid>\AppData\Roaming\Microsoft\Windows\SendTo .
Right-click on a blank spot in the right window pane & choose New > Shortcut
Click Browse & find C:\Windows\notepad.exe then click "OK" & "Next"
Name the shortcut AdminNotepad & hit "Finish"
Then right-click on the new shortcut & choose "Properties"
Under the shortcut tab click "Advanced"
check the box "run as administrator" then click "OK" & "OK" again.

To use your new shortcut go to the logs folder & right-click on CBS.log & choose Send To>AdminNotepad
 
Top