run as administrator

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#2
One way ... put the EXE name in the target of the shortcut. Then you'll have the "run as admin" option. For example,

Code:
Target: g:\tc22\tcc.exe [/k | /c] [path\]file.btm
 
Aug 23, 2010
166
2
#4
When I create a shortcut to a *.BTM file, I go into advanced, but it does not let me select "run as administrator". Is there a way around this?
Which page you are trying to change it on? There's two places in shortcut, where you could do it.
On the "Shortcut" tab - to change shortcut properties.
On the "Compatibility" tab - to change properties OF THE PROGRAM ITSELF. This is not possible for documents for obvious reasons.
 
#5
That's odd. It works as expected for me. Windows 7 x86:
Not here, also Win 7 x86.
1522532854966.png

I have these. What do you have Charles?
Code:
g:\tc22> regdir /v /d HKCR\.btm
HKCR\.btm
   : REG_SZ : TCC.Batch
  Content Type : REG_SZ : text/plain
  PerceivedType : REG_SZ : text

g:\tc22> regdir /v /d HKCR\tcc.batch
HKCR\tcc.batch
  SHELL
    OPEN
      COMMAND
         : REG_SZ : "G:\tc22\tcc.exe" /c "%1" %*
  shellex
    DropHandler
       : REG_SZ : {86C86720-42A0-1069-A2E8-08002B30309D}
 
Aug 23, 2010
166
2
#6
Code:
regdir /v /d HKCR\.btm
HKCR\.btm
   : REG_SZ : takecommand.script
regdir /v /d HKCR\takecommand.script
HKCR\takecommand.script
   : REG_SZ : JPSoft TakeCommand script (console)
  Shell
    Open
      Command
         : REG_EXPAND_SZ : "C:\Programs\TCC-RT\tcc.exe" /S /C "%1" %*
Win7 Pro SP1 64-bit.
 
#7
Code:
c:\users\jlc\utils>ver

TCC  22.00.40 x64   Windows 7 [Version 6.1.7601]

c:\users\jlc\utils>regdir /v /d HKCR\.btm
HKCR\.btm
   : REG_SZ : TCCRT.Batch

c:\users\jlc\utils>regdir /v /d HKCR\tcc.batch
HKCR\tcc.batch
  SHELL
    OPEN
      COMMAND
         : REG_SZ : "C:\Program Files\JPSoft\TCMD22\tcc.exe" /c "%1" %*

c:\users\jlc\utils>regdir /v /d HKCR\tccrt.batch
HKCR\tccrt.batch
  SHELL
    OPEN
      COMMAND
         : REG_SZ : "C:\Program Files\JPSoft\TCC_RT_22\tcc.exe" /c "%1" %*
 
#10
After I added the "Runas" subkey (plus its contents, see below) "Run as administrator" became available in the shortcut's properties.
Code:
v:\> regdir /v /d HKCR\tcc.batch
HKCR\tcc.batch
   : REG_SZ : TCC BTM File
  SHELL
    OPEN
      COMMAND
         : REG_SZ : "G:\tc22\tcc.exe" /c "%1" %*
    Runas
      command
         : REG_SZ : "G:\tc22\tcc.exe" /c "%1" %*
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,483
44
Albuquerque, NM
prospero.unm.edu
#11
Not here, also Win 7 x86.
View attachment 1909

I have these. What do you have Charles?
Code:
g:\tc22> regdir /v /d HKCR\.btm
HKCR\.btm
   : REG_SZ : TCC.Batch
  Content Type : REG_SZ : text/plain
  PerceivedType : REG_SZ : text

g:\tc22> regdir /v /d HKCR\tcc.batch
HKCR\tcc.batch
  SHELL
    OPEN
      COMMAND
         : REG_SZ : "G:\tc22\tcc.exe" /c "%1" %*
  shellex
    DropHandler
       : REG_SZ : {86C86720-42A0-1069-A2E8-08002B30309D}
Code:
C:\>assoc .btm
.btm=btmfile

C:\>regdir /v /d HKCR\btmfile
HKCR\btmfile
   : REG_SZ : Take Command Batch File
  shell
    Debug
       : REG_SZ : Debu&g
      command
         : REG_SZ : "C:\Bin\TCmd19\TCC.EXE" /c bdebugger "%1" %*
        JP shell version : REG_SZ : C:\Bin\TCmd19\TCC.EXE 19.02
    edit
       : REG_SZ : &Edit
      command
         : REG_EXPAND_SZ : %SystemRoot%\System32\NOTEPAD.EXE %1
    open
      command
         : REG_SZ : "C:\Bin\TCmd19\TCC.EXE" /c "%1" %*
    print
       : REG_SZ : &Print
      command
         : REG_EXPAND_SZ : %SystemRoot%\System32\NOTEPAD.EXE /p %1
    Run in Take Command 19
       : REG_SZ : Run in Take Command 19.02 ta&b
      command
         : REG_SZ : "C:\Bin\TCmd19\tcmd.exe" /t "C:\Bin\TCmd19\TCC.EXE" /k "%1"
    Run in TCC 19
       : REG_SZ : Run in &TCC 19.02
      command
         : REG_SZ : "C:\Bin\TCmd19\TCC.EXE" /c "%1" %*
    Run in TCCLE 13
       : REG_SZ : Run in &TCCLE 13.06
      command
         : REG_SZ : "C:\Bin\TCCLE\TCC.EXE" /c "%1" %*
    runas
      command
         : REG_SZ : "C:\Bin\TCmd19\TCC.EXE" /c "%1" %*

C:\>
I guess it's been awhile since I've updated my associations!
 
#13
It's the existence of a SHELL\RUNAS key which lets you choose "Run as administrator" in a shortcut to a .BTM. See my previous post.

And you have that key, Charles D. So you could "Run as administrator".
 
#14
Looks like those verbs are from RegTweaks.btm - but I am still unclear about the line the following line:

JP shell version : REG_SZ : C:\Bin\TCmd19\TCC.EXE 19.02
 
#15
This command, run elevated by the TCC you want to handle BTMs, works here.

Code:
reg add HKCR\%@assoc[.btm]\SHELL\RUNAS\COMMAND /ve /d "\"%_cmdspec\" /c \"%%1\" %%*"
Here's what it does (before/after).

1522684913408.png
 
#18
Thank you Charles. What is the line number and contents from RegTweaks that generates that line please? The one I have is:

Date/time: 1/5/[email protected]:04pm
Size: 25.2 KB (25,852 bytes)

Is that your latest version?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,483
44
Albuquerque, NM
prospero.unm.edu
#20
Thank you Charles. What is the line number and contents from RegTweaks that generates that line please? The one I have is:

Date/time: 1/5/[email protected]:04pm
Size: 25.2 KB (25,852 bytes)

Is that your latest version?
The version I'm looking at is dated 2016-01-26. Don't know whether I ever distributed this one or not.

Which line are you asking about, the "JP shell version" line, or the RunAs line? The former is created by a subroutine called add_debug_verb. RunAs is created just before the Edit and Print verbs.
 
#21
The output from a PDIR of regtweaks. is yours different? If it is - be great to have the updated copy...

Vince, I have it as "prospero.unm.edu\RegTweaks.btm" - i have attached mine at the BTM..... the TXT is for Charles.
 

Attachments

#24
Thank you. After sorting the FTP listing by date - why are so many files timed as 12:00:00 AM? Looks like you did a lot of trimming on the new RegTweaks... have to look at it more closely
 
#26
Whatever caused it - all files on or before [9/19/2017 12:00:00 AM], no middle files, then files on or after [10/12/2017 10:57:00 AM] are all not midnight or noon. Do you kmnow if you did something different between those dates?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,483
44
Albuquerque, NM
prospero.unm.edu
#27
Whatever caused it - all files on or before [9/19/2017 12:00:00 AM], no middle files, then files on or after [10/12/2017 10:57:00 AM] are all not midnight or noon. Do you kmnow if you did something different between those dates?
Older files were bulk-copied from an earlier version of Prospero, using CoreFTP or some other free FTP software -- I really don't remember the details. Newer files were uploaded individually, as available, by a TCC batch file.
 
Aug 23, 2010
166
2
#28
Joe Caverly and AnrDaemon ... is "Run as administrator" available in your BTM's properties?
Nice find. Indeed, I have no "run as administrator" on the BTM links. Somehow it did not appear to me, that all the .lnk I was inspecting were direct links to tcc-rt.exe, not to the corresponding BTM.