run notepad as administrator from command line

How do I run notepad from command prompt? The following borrows techniques from Amr Ali's helpful WSH-assisted answer; save and run as run-elevated.cmd, for instance: Speaking of Amr Ali's WSH-assisted answer; here is a reformulation that makes passing the arguments through more robust, so that arguments such as "a & b" may be passed, and prevents duplicating "^" characters in arguments by avoiding the use of call - see line set ELEVATE_CMDLINE=; also, apart from some formatting for readability, it is ensured that none of the original batch statements are accidentally echoed: I personally did not satisfied with any of suggested solutions so I traced and find out how microsoft itself is running some commands as administrator without any confirmations. If you can link to documentation that would be nice. Click Run as Administrator on the right to open a new elevated command prompt. It does for me anyway. For example, if you want to open registry editor as administrator of the computer, the command would be as below. copy paste below lines to a notepad and save it as sudo.cmd and place it in the system32 folder, @echo Set objShell = CreateObject("Shell.Application") > %temp%\sudo.tmp.vbs, @echo args = Right("%", (Len("%") - Len("%1"))) >> %temp%\sudo.tmp.vbs, @echo objShell.ShellExecute "%1", args, "", "runas" >> %temp%\sudo.tmp.vbs, Now, take a Run terminal and type sudo notepad. value="pl">Polish. Open a command line using Win + R and type cmd.exe. I'll try the updated version. Applications of super-mathematics to non-super mathematics, Torsion-free virtually free-by-cyclic groups. But remember that this is only true for traditional desktop (Win32) programs since apps available through the Microsoft Store can't run elevated. Double-clicking on this newly created shortcut will launch Notepad as admin on your PC. How to run app as administrator using Command Prompt. However, sometimes, some trusted programs may require elevated permissions to work as intended, and knowing the steps to run them with appropriate permissions will come in handy. Please refresh the page and try again. Other than quotes and umlaut, does " mean anything special? Save my name, email, and website in this browser for the next time I comment. Find centralized, trusted content and collaborate around the technologies you use most. Step 1: Open the Start by either clicking the Windows logo key on the bottom left corner of the screen or by pressing the Windows logo key on the keyboard. and need to remove the checkmark on read-only on properties of my file. value="fi">Finnish