Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Power Shell in a TCMD window

Jul
304
0
If I run TCMD as Administrator (option on shortcut) do the tabs that I then open -- such as PowerShell -- inherit those Admin properties?

Regards,
Chuck Billow
 
That's the way it works for CMD.EXE. I assume PowerShell would be the same.
 
Cool. IS there a way I could have found that out "on my own" from TCMD or the software running in the tabs?
 
You can ask PowerShell (of course it isn't easy). Here's a simplification of some code I Googled up.

Code:
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$prp=new-object System.Security.Principal.WindowsPrincipal($wid)
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator
$IsAdmin=$prp.IsInRole($adm)
if ($IsAdmin) { echo yes }
 
If you run CMD.EXE in a tab in an elevated Take Command, the tab caption will start with "Administrator:" -- reflecting the underlying console window.
 

Similar threads

Back
Top