Windows 8 and 8.1 Forums


Is there a faster way to open text files as administrator?

  1. #1


    Posts : 5
    Windows 8 64bit

    Is there a faster way to open text files as administrator?


    I have to open a lot of text-based files on my computer each day to change settings and such (for example the hosts file or the http.conf file, etc.)
    In order for this to work I need to press win-key, find Notepad, right-click, select run as administrator, then open file, browse to the file location and finally open the file.
    I am hoping there is a faster way (preferably via right-clicking the files) to open/edit a text-based file as admin?

      My System SpecsSystem Spec

  2. #2


    Posts : 446
    Win 8 64-bit


    Right click on Notepad > then click on 'open file location'.

    Then right click the Notepad shortcut icon > in 'shortcut' tab click on the 'Advanced' button > tick 'run as administrator'.
      My System SpecsSystem Spec

  3. #3


    Posts : 446
    Win 8 64-bit


    Sorry, ignore the above comment, I misread your post.
      My System SpecsSystem Spec

  4. #4


    Posts : 5
    Windows 8 64bit


    np.
    For now I found a "sort-of" solution by creating a shortcut icon to Notepad in [...]\AppData\Roaming\Microsoft\Windows\SendTo and set that shortcut to run as administrator. This way I can right click any file and send it to Notepad as admin. It does not seem to work on the hosts file however :-( but most other file locations seem to work. If anyone know of a better solution I am all ears.
      My System SpecsSystem Spec

  5. #5


    Posts : 1,925
    Windows 8.1 Pro


    You can set the icon to automatically run as administrator in the icon properties.

    You could also start a command prompt as administrator, then open each file in notepad from the command line.
      My System SpecsSystem Spec

  6. #6


    San Jose - California
    Posts : 2,847
    8.1x64PWMC Ubuntu14.04x64 MintMate17x64


    Download notepadd++ and use it instead, I found that is the fastest way for what you are trying to do since it can open multiple files
    and open them automatically the next time you run it.

    After installation, you'll have an option in context menu: "Edit with notepadd++". This program is much better than the regular windows notepad and it's free.

    NOTE:
    Do not set its property to run as Administrator, otherwise when you try to open hosts file, you'll get an error message, I think it has to do with some security restriction that Windows 8 put in System Folders. Just go ahead and open all the files that you need to edit then close notepadd++, Now reopen Notepadd++ by right click on it and run as Administrator, You can do it from the Start Screen by right click its icon and on the bottom, there's an option to run as admin or create a shortcut on desktop and run as admin.

    After editing all the files, save them but do not close, just exit Notepadd++. The Next time all you have to do is run it as admin, all the files should be opened in separate tabs.
    Last edited by topgundcp; 13 Dec 2012 at 10:39.
      My System SpecsSystem Spec

  7. #7


    Adelaide
    Posts : 1,338
    Windows 7 Ultimate SP1 (64 bit), Linux Mint 17.1 MATE (64 bit)


    Quote Originally Posted by topgundcp View Post
    Download notepadd++ and use it instead, I found that is the fastest way for what you are trying to do since it can open multiple files
    and open them automatically the next time you run it.

    After installation, you'll have an option in context menu: "Edit with notepadd++". This program is much better than the regular windows notepad and it's free.
    Good suggestion.
      My System SpecsSystem Spec

  8. #8


    A nice feature of Notepad++ if you repeatedly edit the same files is that by default it keeps the tabs for the file alive. i.e. You edit the HOSTS file today and close Notepad++. Next time you open Notepad++, the HOSTS file tab is already there, ready for your next edit.
      My System SpecsSystem Spec

  9. #9


    Adelaide
    Posts : 1,338
    Windows 7 Ultimate SP1 (64 bit), Linux Mint 17.1 MATE (64 bit)

    Check the Preferences


    Make sure you have the setting selected in the "Preferences".

    Click the picture for the animation.

    Click image for larger version
      My System SpecsSystem Spec

  10. #10


    Posts : 3
    Windows 3.11 (Networking Bitch) - 8.1 DURR (eightforums.com ?????)

    The Real Way


    As the previous user mentioned you can keep a file open in Notepad++ but you'd still have to open it elevated every time.

    The real way to do this is to use Microsoft Application Compatibility Toolkit. There you can create a database (custom location that holds your fixes) and create a fix.

    Create a fix - Fill out Name Org and then browse to file.
    (if system file like regular notepad you obviously go to the %windir% / C:\windows / C:\Windows\System32 dir.
    (database might have to be saved before starting but i'm not 100% sure. Do it anyway because it might be a little tricky to do it the first time (saving the database that it))
    (Also databases are both saved and installed !!!)
    This fix will have options "RunAsInvoker" selected.
    DO NOT SELECT "RunAsAdmin" ----- but do select "RunAsInvoker".
    (trust me, I tried it)

    Click next.

    Scroll down to verify RunAsInvoker is checked or just Click the "Show Selected" button to filter the results to only that of which you
    checked.

    Hit next. Click "Auto-Generate" and wait till completed.
    Finally hit finish.
    After you are done the last step is accomplished either of two ways.

    1 is right click to install the fix (you are installing the database but think of it the same.
    2 (more common because method 1 doesn't always work is to add the database through elevated cmd.exe with command:


    (if this next line confuses you smh. jkjk look down for that ah-ha moment.
    SDBInst \\<Path to .sdb file>\<FileName>.sdb



    ex:
    sbdinst C:\myNewCompatabilityDatabases\databaseForTextEditors.sdb
    (any location is fine as you have run cmd.exe as an administrator (elevated))

    As always quotations are needed if any spaces are within your path to .sdb file.

    ex: "C:\Cool Shit\myDatabase.sdb"





    NOTES for the confused:
    -------------------------
    You can have multiple fixes in each database.

    (Not sure if required, but I always uninstall a database before I add a new fix to a database that already exists.)

    This is the official MS way. The other UAC bypass methods work by adding a shortcut in the Scheduled Tasks manager.
    This way is fine, but only works by running a shortcut. (so you would have to execute that 1 file for elevated access)
    This official way I have given works globally. (system wide)

    I am lazy as f right now so just look it up its easy and gets more easy the next time.

    Don't disable UAC as that is what the common idiot will do.
    This is analogous to telling a kid to not touch the fire. THEY really want to do it but when the get a rusty pipe inserted up their (use imagination) ntoskrnl.exe file (you're a sick fuk man!) they are going to be very sad as they can not play minecraft until mommy buys new h@x0r t3r|\/|1n@l_
      My System SpecsSystem Spec

Is there a faster way to open text files as administrator?
Related Threads
Is there a way to set my administrator account to require a password when being awakened, but allowing my user account to automatically open? It seems any setting I've tried applies to the whole computer. I used the admin user for maintenance and want to keep it secure, but I'm more lax about my...
Hi All, I am really annoyed by one error I keep getting. I was just about to develop a website from the scratch so just wanted to have everything setup before starting. So, I installed apache server on my system. Now the issue is, I am not able to update config 'httpd' file as it shows "Access...
When I right click on run and select open as administrator, I get the following error: file:////C:/users/pc/appdata/roaming/microsoft/windows/start menu/programs/system tools/run.lnk The parameter is incorrect. It doesn't give this message when trying run anything else as an administrator as...
Solved Can't open using the Build-in Administrator Account in User Accounts and Family Safety
I only have one account on my computer, which appear to be "Build-in Administrator". I can do everything on my computer, but the only thing that I can't is open all the programs that It came by default when you install the Windows 8 Pro (messaging, music, new, photos, videos, weather, reader,...
I have files from a previous version names "office.org 1.1 text document" that my new windows 8 cannot open. Any chance I can recuperate those files ? Thanks a lot.
Is there a way to open the mail or calendar apps in the administrator account on the computer?
I accidentaly associated theme files with notepad , and now I can't run theme files. How can I fix it ? What is the right application for open with command? Thanks in advance.
Eight Forums Android App Eight Forums IOS App Follow us on Facebook