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.
“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 “/k†tells cmd.exe to stay open, otherwise, it would execute the command and then close.”
What is “Q-Dir†for?
I’m using Edge and FF and saw this cryptic signs on both…
Sorry for that, I have removed the garbled characters.
Sorry buy I love Q Dir but can’t run it as admin. I right click it and pick run as Admin but when I open the program and try to move a file I get the error msg. You need permission. I am the only user on the pc and I have full rights. Any hints? Maybe a run cmd?
I’m trying out q-dir now.
I like the 4 window option, but find it lacking in other areas.
Why doesn’t it it have it’s own search engine.
Why as in programs such as free commander, total commander and others is there no multi rename option.
Why are there no keyboard shortcuts for such operations as moving and copying.
The other thing i like about is that you can change the default colours quickly.
Oh, and how do i get rid of that bloody clicking noise.
Really nice to Ghacks continuing to live on, Honestly if I could write a article in little or no time, I would just email to Martin. Its a love hate relationship with this website, but there’s one thing I can say for sure, no matter what I’ll ways come back. Thanks Guys.
The use of a third party explorer is not required. You can do the exact same trick with just regular Windows explorer…
1. Close explorer.exe
2. Open run / taskmgr >new task
3. Navigate to c:/windows right click explorer.exe and run as admin
Now everything you run will be as admin.
The great thing about this method is it’s very easy to automate it via a bat script and requires no external application. (I’m on my phone on the train, otherwise I would share script)
Hi Matthew
I just tried that but it involved killing the explorer.exe process, which kills your desktop and your taskbar.
I was then able to run explorer.exe as Administrator but it loads the Administrator’s desktop and taskbar. I then ran the Windows Explorer and any application kept running as my normal account, not the Administrator.
Explorer.exe is part of the Windows shell so I’m not sure how well it will behave as it will be running half as your normal account and half as Administrator.
Q-Dir being that is standalone application, won’t reset the Windows shell and the you can cleanly close it and close any application that you launched from it.
It would be cool to learn how you would do this though and have a look at your script.
Thanks for sharing.
Thanks everyone and thanks Martin to allow me to post on your site.
I hope to contribute with more content soon. Many of the tools I use everyday I knew about from Ghacks so this is my way to contribute back to the site.
Keep up the good work Martin :)
I welcome every program review for admins :D
Every program that starts as admin has Admin child processes. But this custom commands are really nice. I will try them :D Really nice post. Keep up good work (y)
Excellent. I think that explains why I couldn’t open the c:\users\xxx\sendto folder in Q-Dir
I ‘ll be running this as Admin from now on.
I like portable Explorer++ best. Even working great in Windows 10 build 10061.
I use Q-Dir constantly, but was not very familiarized with this command options.
Thanks Alex for this great tutorial. Hope to read more in the coming months ;)