Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm - run terminal (cmd) as administrator

On Windows it's easy to run cmd application as administrator:

Right click on cmd icon >> run as administrator`

But I would like to use PhpStorm terminal tool as administrator since I constantly have to execute queries that require administrator role.

When I open:

File >> Settings >> Tools >> Terminal

I can see that it is directly connected to cmd.exe and there are options to be filled:

enter image description here

And I see no checkbox with choice to run it as administrator.

QUESTIONS

  1. Is it even possible?
  2. If yes how do I do it?
  3. Using settings or other way?
like image 519
Ignas Damunskis Avatar asked Jan 04 '17 11:01

Ignas Damunskis


People also ask

How do I open Phpstorm terminal?

From the main menu, select View | Tool Windows | Terminal or press Alt+F12 .

How do I run terminal as admin in PyCharm?

From Windows start menu right click the Pycharm shortcut and select 'Run as administrator. ' Optionally create a short and change the options to always Run as Administrator under the "Compatibility" tab. Simply run the PyCharm shortcut as administrator, and then PyCharm terminal will run with admin privileges.

How do I run a terminal in IntelliJ?

Opening a Terminal Window We can open the terminal window with ⌥F12 on macOS, or Alt+F12 on Windows and Linux. The terminal supports all the same commands that the operating system supports. and press enter.


1 Answers

There are no options in the IDE for that at the moment: to run the shell (cmd.exe, powershell.exe etc.) with higher rights.

https://youtrack.jetbrains.com/issue/IDEA-121335 -- watch this ticket (star/vote/comment) to get notified on any progress. Maybe someone will post some possible workarounds there...


Your only option for now (that I'm aware of) is running IDE itself as Administrator -- Process Hacker tool confirms that both the IDE and cmd.exe will be run with elevated rights.


P.S. For one time execution (or if you need to run IDE as normal user) -- have a look at this question and offered solutions: How to open an elevated cmd using command line for Windows?

like image 184
LazyOne Avatar answered Sep 22 '22 09:09

LazyOne