Page 1 of 1

Give "elevated" dos box also

Posted: 22.09.2014, 12:17
by vsrawat
I today noticed that fc gives menu option (^D) to open dos box.

However, I find that it is non-elevated dos box that doesn't have admin access.

I wonder why nobody has requested so far to give some menu option or shortcut to open an Elevated dos box having admin access.

I mean, is some method already available, if so, please share with me.

Otherwise, please consider whether such an option is needed.

Thanks.
--
Rawat

Re: Give "elevated" dos box also

Posted: 22.09.2014, 12:41
by Karol
Define favorite tool with
%windir%\system32\cmd.exe
and check the option 'With "Run As" dialog'.

Re: Give "elevated" dos box also

Posted: 22.09.2014, 22:46
by twiga
@Karol: Launching any command (like cmd) with a "run as" admin account will not give you the UAC elevation that makes you really admin in that moment. It will launch with your admin credentials, but in limited user context only.

@vsrawat: I think if you launch FC with elevated "run as administrator" from context menu and then start a dox box from execution line or from favorites the cmd should also inherit elevation.

Re: Give "elevated" dos box also

Posted: 23.09.2014, 08:16
by Karol
Launching any command (like cmd) with a "run as" admin account will not give you the UAC elevation that makes you really admin in that moment. It will launch with your admin credentials, but in limited user context only.
Could you explain it more exactly?
I know, we can start DOS prompt from the start menu (Accessories: Command prompt; rmb; Run as adminitrator). You mean it is not the same with the start as favorite as I supposed? Could you give some example what can I not make in that DOS box?

Re: Give "elevated" dos box also

Posted: 23.09.2014, 20:15
by twiga
Hello Karol:
If you start a cmd from Accessories with right click "Run as Administrator" you force the UAC elevation and get an elevated cmd prompt from which you can do anything.
From within FC file panel you can do the same and right click cmd.exe and start it elevated.
But I do not know any way to achieve this from the menu/command line/favorites in FC

The "run as" checkbox in FC does the same as the system built in "run as": it executes as a another user account, an admin account for example.

UAC works that way that being an admin does not make you admin except if you force the UAC elevation dialog.

If I don't misunderstand it the base situation we look at is as follows:
you are working on a UAC enabled machine and start FC without UAC elevation.
The result is that FC runs in limited user context (even if your user is member of the local admin group)

Regardless how you start the cmd.exe within FC (Favorite with "run as" checked, from the FC command line or from Tools menu) the resulting dos box will run in limited user context only.

cmd.exe does not trigger any UAC elevation on its own, even if you specify "run as" with an admin account.

From such a "admin" dos box you can not access anything that needs admin privileges (say delete a file in system32 dir).
It depends a bit what you are calling from this dos box: say you call a setup.exe from there it could happen that this setup.exe will trigger the UAC dialog for its own. But this UAC awareness depends very much on the programmer of the software you launch from that dos box.

The only way to get an UAC elevated dos box in FC is to trigger a UAC prompt directly with a right click on a link that calls cmd.exe (or you browse to cmd.exe directly) and choose "Run as Administrator" (note again that this not the same as "run as" with an admin account).
Or you start FC right away with "Run as Administrator" UAC elevation. In that case anything you start from Favorites, Tools menu or from the file panel will of course also be elevated because the father process FC is already elevated.

regards
twiga

Re: Give "elevated" dos box also

Posted: 08.11.2014, 08:12
by Link68759
This will help

http://code.kliu.org/misc/elevate/

Move that to your Windows directory.

You could do one of three things with this

1) Figure out if FC has a variable for the current directory and set the "DOS box command specification" to something like: elevate cmd /k "cd fc-current-directory"
2) Create a shortcut in the toolbox for an elevated cmd prompt (elevate cmd), leave the dosbox settings alone.
3) Don't elevate the cmd, elevate whatever you're trying to do within[/] the cmd. For example, open FC's dosbox as normal, and precede any command with "elevate" like so: "elevate del readme.txt"

Number 3 is the wisest choice. If you're familiar with linux, rename elevate to sudo and enjoy. Running FC as admin, suggested above, is a terrible idea.