Supercharge Q-Dir with custom commands and administrative privileges
I work in IT Support in a company where our users don't have administrator rights. As per my job, I have to constantly access part of the operative system that require Administrator rights (registry keys, services, drivers, etc.) and it is a pain to ask the user to log off from their machines so we can login with our Administrator account.
You can always right click the application and run as Administrator and enter the administrator's password, but what if you require access to more than one piece of software, you would have to run and enter the password for each one of those applications.
There's an easier way; you can run a Windows Explorer alternative like Q-Dir and every application that you run from it will have admin rights. Martin already talked about Q-Dir here on Ghacks before.
So this is how I use Q-Dir: Download Q-Dir Portable to get started and extract the application, find Q-Dir.exe and run it as Administrator.
Now any application that you launch from within Q-Dir will run as Administrator. You can check that by looking at the Task Manager. In this example, I am running Notepad as Administrator.
So what else can you do with Q-Dir?
There's a feature within Q-Dir where you can add custom commands. It's called RUN and it acts pretty much like the Windows Run window (Win + R). You can find it at the bottom of every Q-View.
The cool thing about it is that you can save your most used commands and then execute them with a single click. By default, Q-Dir already comes with some useful commands but if you click Add, you can add your own.
I added another command by typing Support/Ipconfig=%sysdir%\cmd.exe = /k ipconfig at the end of the list and then Save (the OK button does not seems to save your commands).
You need to add the= sign if you want to send a parameter to the application you are trying to run (in this case the Command Prompt). The / tells cmd.exe to stay open, otherwise, it would execute the command and then close.
This new command will add a new item to the list.
You can also add commands to execute other portable programs.
I have created a new folder called Applications under the Q-Dir folder and I have placed in there another useful application called Process Explorer (procexp.exe).
So now I can add Process Explorer to my commands and execute it with Administrator rights by adding this to the list Support/Process Explorer=.\Applications\procexp.exe and then clicking Save.
Q-Dir adds the icon of the application automatically. If Q-Dir shows a blank icon, it means that it couldn't find the file or the executable you are trying to run so you need to double check your command.
All these settings are saved in the Q-Dir.ini file in the same folder where Q-Dir.exe is located (for portability reasons).
You can keep adding more applications and commands, some others commands I have found useful are:
- Manage your PC: Support/Manage PC=%sysdir%/compmgmt.msc
- Access the Windows Services: Support/Services=%sysdir%/services.msc
- Access the Printer Server: Support/Print Server=%sysdir%/cmd.exe = /c rundll32 printui.dll,PrintUIEntry /s /t1 /c \\\%computername%
WARNING: save your files before executing these:
- Turn off your PC in 10 seconds: Support/PC/Shutdown (10s)=%sysdir%\shutdown.exe = /s /t 10
- Restart your PC in 10 seconds: Support/PC/Restart (10s)=%sysdir%\shutdown.exe = /r /t 10
Hope you guys found this guide useful. Q-Dir is part of the tools I use everyday for my job and these commands make my life easier.Advertisement