1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Running as Administrator

Discussion in 'TCC/LE Support' started by sedentaryz, Nov 18, 2008.

  1. sedentaryz

    Joined:
    Nov 18, 2008
    Messages:
    1
    Likes Received:
    0
    Running TCC/LE on a Vista-based system, when I start TCC in "run as administrator" mode, is there any way to visually identify that 'admin' window as different from other 'standard' mode TCC windows?

    I usually have several TCC/LE command prompt windows open and from time-to-time need to start one as Administrator. Because it doesn't have any visual indicator that it is running in an elevated privileges mode, I can't later identify which of the many windows is in Admin mode.

    Thanks!
     
  2. holla

    Joined:
    Nov 13, 2008
    Messages:
    17
    Likes Received:
    0
    One way to do this is below. It will put administrator: in the title bar -
    It assumes that you can create a file in windows directory only if you are running the program as admin.

    set fname=%@unique[c:\windows]
    if not [%fname%]==[] (
    Title Administrator: ...
    del %fname%
    )

    The script works, but then when you are not running as administrator, %@unique will flash some error messages on the screen saying access denied. Just ignore them. I could not figure out how to suppress that.
    Anyone else can help with that?
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    JP Software Forums" <neil@jpsoft.com>; "holla wrote:
    | One way to do this is below. It will put administrator: in the title
    | bar -
    | It assumes that you can create a file in windows directory only if
    | you are running the program as admin.
    |
    | set fname=%@unique[c:\windows]
    | if not [%fname%]==[] (
    | Title Administrator: ...
    | del %fname%
    | )
    |
    | The script works, but then when you are not running as administrator,
    | %@unique will flash some error messages on the screen saying access
    | denied. Just ignore them. I could not figure out how to suppress
    | that. Anyone else can help with that?

    Try ON ERROR:

    setlocal
    on error goto NORMAL
    set fname=%@unique[c:\windows]
    Title Administrator: ...
    del %fname
    :NORMAL

    Note: in the regular version of TCC (not in LE) the internal variable _ADMIN
    has value 1 if running as administrator. One of the plug-ins available for
    LE also has a similar feature.
    --
    HTH, Steve
     

Share This Page