Restart Elevated
Restart Elevated
I regularly do this:
quit XY
relaunch it in administrator mode
do several stuff in this mode
quit XY
relaunch it in normal mode
To save time, it would be fine to have an option "Restart Elevated" and another one "Restart"
quit XY
relaunch it in administrator mode
do several stuff in this mode
quit XY
relaunch it in normal mode
To save time, it would be fine to have an option "Restart Elevated" and another one "Restart"
Re: Restart Elevated
A workaround is go to http://www.nirsoft.net/utils/nircmd.html and download nircmd. Extract both executables and put them in C:\Windows\.
Now make a new Custom Toolbar Button. For the script, use:
There is some nice added benefits with the script above. XYplorer will open up a new process that is elevated. The old one will still be running so you won't lose anything. Do what you need with the elevated XYplorer process and then simply quite without saving. Voila!
Now make a new Custom Toolbar Button. For the script, use:
Code: Select all
Run """nircmd"" elevate ""<xy>"" /ini=""<xyini>"" ""<curpath>""";
Re: Restart Elevated
If thinking of nircmd: use WSCC (Windows System Control Center) - it includes many many tools, also nircmd. It really can be helpful!
(Can be used portable!)
(Can be used portable!)
Win11 Pro 223H2 Gerrman
Re: Restart Elevated
Completely agree and support! I have it on my USB drive with me as well. Excellent stuff! It's a bit of overkill but I also have GEGeek Tech Toolkit just in case zombie apocalypse. Although XYplorer during a zombie apocalypse should be my primary tool...PeterH wrote:If thinking of nircmd: use WSCC (Windows System Control Center) - it includes many many tools, also nircmd. It really can be helpful!
(Can be used portable!)
Re: Restart Elevated
This might be easier. And altogether cleaner (you don;t have to download anything, not saying nircmd is bad though).
Enterinto the addressbar. A textbox will open. Copy the following code and paste it into that box (and ENTER).
Now a new button will get added to the toolbar.
Click it to: restart ELEVATED (using vbscript), or UNELEVATED (using explorer.exe ) or just restart in current mode. You can also open a new ELEVATED instance of XYplorer.
(edit) Don't ask me why explorer can start things in unelevated mode FROM WITHIN an elevate program. Where cmd.exe ,psExec from sysinternals, and runas /trustlevel:0x2000 all failed. I know I'll not forget this interesting and quite useful ( ) feature of WE.
(edit2: added new "Open new elevated instance" option to the ctb)
Enter
Code: Select all
::snippet;
Code: Select all
Snip: CTB 1
XYplorer 14.80.0000, 12/23/2014 5:23:29 PM
Action
NewUserButton
Name
Restart...
Icon
:refresh
ScriptL
"Open new ELEVATED XYplorer"
$elevator = "<xyscripts>\utils\elevXY.vbs";
writefile($elevator, <<<#elevcontent
set oSh = CreateObject("Shell.Application")
oSh.ShellExecute "<xy>", "/new", "", "runas"#elevcontent,o);
}
//savesettings;
run "wscript.exe ""$elevator"" ""<xy>""",,0,0;
"-"
"Restart with ELEVATED privileges"
$elevator = "<xyscripts>\utils\elevXY.vbs";
writefile($elevator, <<<#elevcontent
set oSh = CreateObject("Shell.Application")
oSh.ShellExecute "<xy>", "", "", "runas"#elevcontent,o);
}
savesettings;
run "wscript.exe ""$elevator"" ""<xy>""",,0,0;
exit n;
"Restart with UNELEVATED privileges"
savesettings;
run "%WINDIR%\explorer.exe ""<xy>""";
exit n;
"Restart in current mode (saving settings)"
exit sr;
ScriptR
FireClick
0
Click it to: restart ELEVATED (using vbscript), or UNELEVATED (using explorer.exe ) or just restart in current mode. You can also open a new ELEVATED instance of XYplorer.
(edit) Don't ask me why explorer can start things in unelevated mode FROM WITHIN an elevate program. Where cmd.exe ,psExec from sysinternals, and runas /trustlevel:0x2000 all failed. I know I'll not forget this interesting and quite useful ( ) feature of WE.
(edit2: added new "Open new elevated instance" option to the ctb)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Restart Elevated
Explorer is not the only one. CPAU ( http://www.joeware.net/freetools/tools/cpau/index.htm ) can do the same thing. But it won't be able to do the reverse on NT 6.x, i.e. where there's UAC - starting something elevated from an unelevated environment.SammaySarkar wrote: (edit) Don't ask me why explorer can start things in unelevated mode FROM WITHIN an elevate program. Where cmd.exe ,psExec from sysinternals, and runas /trustlevel:0x2000 all failed. I know I'll not forget this interesting and quite useful ( ) feature of WE.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Re: Restart Elevated
Really? Making me all jelly with that code. Well, nircmd still has its own uses like opening cd trays and other advance features. With it I can at least claim that XYplorer can open CD trays so that I can use them as cup holders.
Joking aside, that's actually quite neat! I really need to learn vbscript.
Joking aside, that's actually quite neat! I really need to learn vbscript.
Re: Restart Elevated
Hi,
this logic really should be made XY-intern, maybe added to the File menu as Restart Elevated and/or Start Elevated Instance.
@Sammay:
Filehero
this logic really should be made XY-intern, maybe added to the File menu as Restart Elevated and/or Start Elevated Instance.
@Sammay:
Filehero
SammaySarkar wrote:This might be easier. And altogether cleaner (you don;t have to download anything, not saying nircmd is bad though).
Enterinto the addressbar. A textbox will open. Copy the following code and paste it into that box (and ENTER).Code: Select all
::snippet;
Code: Select all
Snip: CTB 1 XYplorer 14.80.0000, 12/23/2014 5:23:29 PM Action NewUserButton Name Restart... ....[/quote]
-
- Posts: 261
- Joined: 02 Dec 2014 16:49
Re: Restart Elevated
Why do you need to switch back and forth between elevated and not? Why not just stay elevated?
I'm genuinely curious.
I'm genuinely curious.
Windows 8.1, 64-bit
Re: Restart Elevated
My standard account isn't a/the admin one, so I wouldn't see all my account specific folders and links (user.home, desktop, documents etc.).aliteralmind wrote:Why not just stay elevated?
In this general regard - and even if it might not be required any longer under Win 8.x - I'm truly an old-fashioned guy, I sudo on demand only.
Cheers,
Filehero
Re: Restart Elevated
Problem with staying elevated all the times is elevated programs don't always play nice with all other programs that are not elevated due to permissions and such. In most cases, you don't want to elevate a program unless it's necessary.aliteralmind wrote:Why do you need to switch back and forth between elevated and not? Why not just stay elevated?
I'm genuinely curious.
Re: Restart Elevated
Security! I generally work as a normal user, and only if it's really neccessary I run it elevated.aliteralmind wrote:Why do you need to switch back and forth between elevated and not? Why not just stay elevated?
Win11 Pro 223H2 Gerrman
-
- Posts: 261
- Joined: 02 Dec 2014 16:49
Re: Restart Elevated
Well, it would be nice to bypass the UAC prompt, by calling an already-elevated shortcut. I'm guessing this isn't possible via an XY internal implementation, but perhaps it's scriptable.
Windows 8.1, 64-bit
Re: Restart Elevated
no good program wearing a white hat should try to bypass the UAC.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Restart Elevated
I do expect, that what Sammay's VBS script does indeed can be done with VB6.aliteralmind wrote:I'm guessing this isn't possible via an XY internal implementation, but perhaps it's scriptable.