3

Ok, I need to get a little into the nitty-gritty of the registry, so here's what I got and what I want.

I'm using a little Word add-in which converts latin letters to cyrillic ones, straight transliteration. Now this add-in must be somewhat less than ideally compatible since it increases Word's start-up time as well as massively increasing its closing time, stalls out for a good 15 seconds before it finally closes. Other times it also messes with the normal.dot template somehow, asking if a any changes are to be saved... well, I can fix all that when I run Word as Admin. Given it didn't quite stick by simply running as Admin from compability settings, I bumped it to Invoker via the Application Compatibility Toolkit.

Now here's where it goes wrong - when I start Word as standalone first and then open a file from within it, it's all swell, no crashes, lags or inordinate prompts. However, if I start word from any given file through explorer, it'll run without the Admin privileges. Same if I open a document via doubleclick while the elevated instance is already running, that just opens a non-admin instance.

Now I went and added a shell entry which gives me the right-click option of opening a word file as Admin, but I'd much rather have it run so through the default doubleclick.

So what I want is elevated admin rights when opening directly from file via regular old doubleclick without relying on shell extensions. Where precisely do I need to dig in the registry to make that magic happen?

1 Answers1

0

What it appears so far that you would have to do is...

1) Find a way to load the program as an administrator...
2) Associate the extension of said program to this previous command.

1) The command would look like powershell -Command "Start-Process 'word.exe' %1 -Verb runAs".
2) This can be done by either right-clicking the file and changing the associated program or by going to the control panel and changing it there. I am sure there are more ways to do it.

Now, this is all fine, but apparently Windows does not want anything more than the name of said program (so the arguments would simply have to be removed). This could be solved by creating a .bat file that functions as a program and takes a filename as its argument and then passes it onto Powershell.

Then the bat file is just this command powershell -Command "Start-Process 'word.exe' %1 -Verb runAs". Now, all that's left is associating the extension you want with this bat file and have at it.

Disclaimer: For a second before the UAC prompt appears you will see command prompt load to execute the batch file. After accepting the UAC prompt, the command prompt will disappear and Windows Power Shell will execute the program with administrative privileges.

These are a couple of images I thought would be helpful to set this system up.

Testing UAC Prompt! Associating Bat File with .txt Extension