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

LPent

New Member
Messages
5
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 Computer

System One

  • OS
    Windows 8 64bit
    System Manufacturer/Model
    Homemade
    CPU
    Intel E6750 (Core2 Duo 2.6GHz)
    Motherboard
    MSI P35 Neo
    Memory
    4x1GB
    Graphics Card(s)
    ATI HD 5570
    Monitor(s) Displays
    2x Dell E197FP
    Screen Resolution
    1280x1024
    PSU
    350W
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 Computer

System One

  • OS
    Win 8 64-bit
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 Computer

System One

  • OS
    Windows 8 64bit
    System Manufacturer/Model
    Homemade
    CPU
    Intel E6750 (Core2 Duo 2.6GHz)
    Motherboard
    MSI P35 Neo
    Memory
    4x1GB
    Graphics Card(s)
    ATI HD 5570
    Monitor(s) Displays
    2x Dell E197FP
    Screen Resolution
    1280x1024
    PSU
    350W
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 Computer

System One

  • OS
    Windows 8.1 Pro
    CPU
    Intel i7 3770K
    Motherboard
    Gigabyte Z77X-UD4 TH
    Memory
    16GB DDR3 1600
    Graphics Card(s)
    nVidia GTX 650
    Sound Card
    Onboard Audio
    Monitor(s) Displays
    Auria 27" IPS + 2x Samsung 23"
    Screen Resolution
    2560x1440 + 2x 2048x1152
    Hard Drives
    Corsair m4 256GB, 2 WD 2TB drives
    Case
    Antec SOLO II
    Keyboard
    Microsoft Natural Ergonomic Keyboard 4000
    Mouse
    Logitech MX
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:

My Computer

System One

  • OS
    8.1x64PWMC Ubuntu14.04x64 MintMate17x64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Home Brewed
    CPU
    I7 4970K OC'ed @4.7 GHz
    Motherboard
    MSI-Z97
    Memory
    16 GB G-Skill Trident X @2400MHZ
    Graphics Card(s)
    NVIDIA GeForce GTS 450
    Sound Card
    X-Fi Titanium Fatal1ty Professional Series
    Monitor(s) Displays
    Dual HP-W2408
    Screen Resolution
    1920X1200
    Hard Drives
    256 GB M2 sm951, (2) 500GB 850EVO, 5TB, 2 TB Seagate
    PSU
    Antec 850W
    Case
    Antec 1200
    Cooling
    Danger Den H20
    Keyboard
    Logitech
    Mouse
    Logitech Performance Mouse MX
    Internet Speed
    35/12mbps
    Browser
    Firefox
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 Computer

System One

  • OS
    Windows 7 Ultimate SP1 (64 bit), Linux Mint 18.3 MATE (64 bit)
    Computer type
    PC/Desktop
    System Manufacturer/Model
    n/a
    CPU
    AMD Phenom II x6 1055T, 2.8 GHz
    Motherboard
    ASRock 880GMH-LE/USB3
    Memory
    8GB DDR3 1333 G-Skill Ares F3-1333C9D-8GAO (4GB x 2)
    Graphics Card(s)
    ATI Radeon HD6450
    Sound Card
    Realtek?
    Monitor(s) Displays
    Samsung S23B350
    Screen Resolution
    1920x1080
    Hard Drives
    Western Digital 1.5 TB (SATA), Western Digital 2 TB (SATA), Western Digital 3 TB (SATA)
    Case
    Tower
    Mouse
    Wired Optical
    Other Info
    Linux Mint 16 MATE (64 bit) replaced with Linux Mint 17 MATE (64 bit) - 2014-05-17
    Linux Mint 14 MATE (64 bit) replaced with Linux Mint 16 MATE (64 bit) - 2013-11-13
    Ubuntu 10.04 (64 bit) replaced with Linux Mint 14 MATE (64 bit) - 2013-01-14
    RAM & Graphics Card Upgraded - 2013-01-13
    Monitor Upgraded - 2012-04-20
    System Upgraded - 2011-05-21, 2010-07-14
    HDD Upgraded - 2010-08-11, 2011-08-24,
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 Computer

System One

  • OS
    Windows 8.1.1 Pro
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Home built
    CPU
    i3-3225
    Motherboard
    H77M-D3H (micro-ATX)
    Memory
    12GB
    Graphics Card(s)
    none (Intel HD4000 IGP)
    Sound Card
    mobo integrated
    Monitor(s) Displays
    Dell U2312HM & Samsung 171N
    Screen Resolution
    1080x1920 (portrait) & 1280x1024
    Hard Drives
    Intel 520, 120GB SSD
    Kingston SNV425S2 64GB SSD
    WD WD10EARS 1GB HDD
    PSU
    Cooler Master eXtreme Power Plus 460W
    Case
    Silverstone TJ-08E
    Cooling
    Intel stock HSF
    Keyboard
    Logitech K260
    Mouse
    Logitech M210
    Internet Speed
    10Mbps/1Mbps DOCSIS
Check the Preferences

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

Click the picture for the animation.

Notepad++.gif
 

My Computer

System One

  • OS
    Windows 7 Ultimate SP1 (64 bit), Linux Mint 18.3 MATE (64 bit)
    Computer type
    PC/Desktop
    System Manufacturer/Model
    n/a
    CPU
    AMD Phenom II x6 1055T, 2.8 GHz
    Motherboard
    ASRock 880GMH-LE/USB3
    Memory
    8GB DDR3 1333 G-Skill Ares F3-1333C9D-8GAO (4GB x 2)
    Graphics Card(s)
    ATI Radeon HD6450
    Sound Card
    Realtek?
    Monitor(s) Displays
    Samsung S23B350
    Screen Resolution
    1920x1080
    Hard Drives
    Western Digital 1.5 TB (SATA), Western Digital 2 TB (SATA), Western Digital 3 TB (SATA)
    Case
    Tower
    Mouse
    Wired Optical
    Other Info
    Linux Mint 16 MATE (64 bit) replaced with Linux Mint 17 MATE (64 bit) - 2014-05-17
    Linux Mint 14 MATE (64 bit) replaced with Linux Mint 16 MATE (64 bit) - 2013-11-13
    Ubuntu 10.04 (64 bit) replaced with Linux Mint 14 MATE (64 bit) - 2013-01-14
    RAM & Graphics Card Upgraded - 2013-01-13
    Monitor Upgraded - 2012-04-20
    System Upgraded - 2011-05-21, 2010-07-14
    HDD Upgraded - 2010-08-11, 2011-08-24,
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 rubbish\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 Computer

System One

  • OS
    Windows 3.11 (Networking handsome frog) - 8.1 DURR (eightforums.com ?????)
Back
Top