Can't right-click a BTM

Jul 12, 2008
286
0
Las Vegas, NV
If I double-click a btm file that is in the root folder (C:\) it runs fine. But if I right-click and try to run same as administrator, I get an error:

This file does not have an app associated with it for performing this action.

Why? How do I fix this?
 
Jun 2, 2008
359
4
Sounds like your administrator account is a completely different one than your non-administrator one. Run TCC as administrator, change to the install folder, and then run the BTM file that sets up the file associations, which will apply them to that account. Or log into Windows as that administrator and then run the association BTM file.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,463
88
Albuquerque, NM
prospero.unm.edu
Not tested, but try something like this from an elevated TCC:

Code:
set assoc=%@assoc[.btm]
echo %@regcreate[HKCR\%assoc\shell\runas\command]
echo %@regset[HKCR\%assoc\shell\runas\command\,REG_SZ,"%_cmdspec" /C "%%1" %%*]
 
Apr 2, 2011
1,441
10
54
North Carolina, USA
Code:
@echo off
rem  TCMDHere.btm
rem  This batch file adds the "TCMD prompt here" entry to Windows Explorer
rem  RunAs mods 2014-06-29 CED

setlocal

  iff %_elevated == 0 then
    start /elevated /c %0 %1
    quit
  endiff

  echo.
  iff "%1" == "/U" then
    echos Do you want to remove TCMD from Windows Explorer, inc. RunAs[Y/N] ?
    inkey /k"yn[enter]" %%var
    iff "%var" eq "y" then
      :: is this corect ?
      echo %@regdelkey["HKCR\Directory\Shell\RunAs\command"] > nul
      echo %@regdelkey["HKCR\Directory\Shell\TCMD\command"] > nul
      echo %@regdelkey["HKCR\Drive\Shell\RunAs\command"] > nul
      echo %@regdelkey["HKCR\Drive\Shell\TCMD\command"] > nul
    endiff
    quit
  endiff

  setdos /c0xff00

  iff %_dosver ge 6.0 then
      echo If you are running Windows 8, 7, 2008, or Vista, you must first start a TCC
      echo session as an administrator (right click on the TCC icon and select "Run as
      echo administrator") and then run TCMDHere.btm in that session.
  endiff

  echo.
  echo Do you want to add a "TCMD prompt here" entry to the Windows Explorer
  echos context (right click) menus for directories and drives [Y/N] ?  ``
  inkey /k"yn[enter]" %%var

  if "%var" ne "y" quit 3

  echo %@regcreate["HKCR\Directory\Shell\TCMD\command"] > nul
  echo %@regcreate["HKCR\Drive\Shell\TCMD\command"] > nul

  iff %@regset["HKCR\Directory\Shell\TCMD\",REG_SZ,TCMD &prompt here] != 0 then
      echoerr Cannot update registry key!
      quit 2
  endiff

  echo %@regset["HKCR\Drive\Shell\TCMD\",REG_SZ,TCMD &prompt here] > nul

  echo %@regset["HKCR\Directory\Shell\TCMD\command\",REG_SZ,"%@path[%_cmdspec]tcmd.exe" /D "%%L"] > nul
  echo %@regset["HKCR\Drive\Shell\TCMD\command\",REG_SZ,"%@path[%_cmdspec]tcmd.exe" /D "%%L"] > nul

  rem Add RunAs verb to run TCMD.exe as Administrator -------------------------------------

  iff %_dosver ge 6.0 then
      echo %@regcreate["HKCR\Directory\Shell\RunAs\command"] > nul
      echo %@regcreate["HKCR\Drive\Shell\RunAs\command"] > nul

      iff %@regset["HKCR\Directory\Shell\RunAs\",REG_SZ,TCMD prompt here (&Admin)] != 0 then
          echoerr Cannot update registry key!
          quit 2
      endiff

      echo %@regset["HKCR\Drive\Shell\RunAs\",REG_SZ,TCMD prompt here (&Admin)] > nul

      echo %@regset["HKCR\Directory\Shell\RunAs\command\",REG_SZ,"%@path[%_cmdspec]tcmd.exe" /D "%%L"] > nul
      echo %@regset["HKCR\Drive\Shell\RunAs\command\",REG_SZ,"%@path[%_cmdspec]tcmd.exe" /D "%%L"] > nul
  endiff

  echo.
  echo The Windows Explorer context menus have been updated.

endlocal
 
Apr 2, 2011
1,441
10
54
North Carolina, USA
Code:
@echo off
rem  TCMDHere.btm
rem  This batch file adds the "TCMD prompt here" entry to Windows Explorer
rem  RunAs mods 2014-06-29 CED

setlocal

  iff %_elevated == 0 then
    start /elevated /c %0 %1
    quit
  endiff

  echo.
  iff "%1" == "/U" then
    echos Do you want to remove TCMD from Windows Explorer, inc. RunAs[Y/N] ?
    inkey /k"yn[enter]" %%var
    iff "%var" eq "y" then
      :: is this corect ?
      echo %@regdelkey["HKCR\Directory\Shell\RunAs\command"] > nul
      echo %@regdelkey["HKCR\Directory\Shell\TCMD\command"] > nul
      echo %@regdelkey["HKCR\Drive\Shell\RunAs\command"] > nul
      echo %@regdelkey["HKCR\Drive\Shell\TCMD\command"] > nul
    endiff
    quit
  endiff

  setdos /c0xff00

  iff %_dosver ge 6.0 then
      echo If you are running Windows 8, 7, 2008, or Vista, you must first start a TCC
      echo session as an administrator (right click on the TCC icon and select "Run as
      echo administrator") and then run TCMDHere.btm in that session.
  endiff

  echo.
  echo Do you want to add a "TCMD prompt here" entry to the Windows Explorer
  echos context (right click) menus for directories and drives [Y/N] ?  ``
  inkey /k"yn[enter]" %%var

  if "%var" ne "y" quit 3

  echo %@regcreate["HKCR\Directory\Shell\TCMD\command"] > nul
  echo %@regcreate["HKCR\Drive\Shell\TCMD\command"] > nul

  iff %@regset["HKCR\Directory\Shell\TCMD\",REG_SZ,TCMD &prompt here] != 0 then
      echoerr Cannot update registry key!
      quit 2
  endiff

  echo %@regset["HKCR\Drive\Shell\TCMD\",REG_SZ,TCMD &prompt here] > nul

  echo %@regset["HKCR\Directory\Shell\TCMD\command\",REG_SZ,"%@path[%_cmdspec]tcmd.exe" /D "%%L"] > nul
  echo %@regset["HKCR\Drive\Shell\TCMD\command\",REG_SZ,"%@path[%_cmdspec]tcmd.exe" /D "%%L"] > nul

  rem Add RunAs verb to run TCMD.exe as Administrator -------------------------------------

  iff %_dosver ge 6.0 then
      echo %@regcreate["HKCR\Directory\Shell\RunAs\command"] > nul
      echo %@regcreate["HKCR\Drive\Shell\RunAs\command"] > nul

      iff %@regset["HKCR\Directory\Shell\RunAs\",REG_SZ,TCMD prompt here (&Admin)] != 0 then
          echoerr Cannot update registry key!
          quit 2
      endiff

      echo %@regset["HKCR\Drive\Shell\RunAs\",REG_SZ,TCMD prompt here (&Admin)] > nul

      echo %@regset["HKCR\Directory\Shell\RunAs\command\",REG_SZ,"%@path[%_cmdspec]tcmd.exe" /D "%%L"] > nul
      echo %@regset["HKCR\Drive\Shell\RunAs\command\",REG_SZ,"%@path[%_cmdspec]tcmd.exe" /D "%%L"] > nul
  endiff

  echo.
  echo The Windows Explorer context menus have been updated.

endlocal

One just needs to change tcmd.exe to tcc.exe in the inline TCMDHere.btm...

It will also be sure you are running it as administrator...
 
Similar threads
Thread starter Title Forum Replies Date
vefatica Pasting into TCMD via right-click menu? Support 2
D No "Format" in right-click menu for DVD Support 11
JohnQSmith Folder pane right-click rename Support 2
J Right click issue Support 2
M open Take Command here right-click? Support 2
D How to? Windows Key-Left and Windows Key-Right Support 9
vefatica Pipes ... not quite right? Support 21
vefatica Ctrl-Alt-L (R, Left, Right). Support 8
C Erase all characters left or right from cursor location Support 2
vefatica How to? TPIPE ... see output right away? Support 4
B Why iexplore get launched right.. Support 4
CWBillow I can NOT get the config(s) right Support 1
N Except chokes on files with right parens Support 4
T TCTOOLBAR /C & TCTOOLBAR /I should reload toolbar from TCMD.INI, right? Support 1
A Escape characters on right side of pipe Support 0
H UNZIP /F and /U still not right 12.0.27 Support 0
B Bdebugger displays an error when typing right square bracket Support 2
G Selection characters with mouse double-click Support 3
vefatica IDE double-click select? Support 29
F Click a .btm file with "TCC Startup Options" in effect. Support 8
C Problem with TAB activation via mouse click Support 3
p.f.moore One-click way of opening a new tab Support 4
K double click to run btm? Support 2
K btm execute ondouble click Support 8
S Starting TCC with double click on tab bar Support 0
MickeyF equivalent to TCSTART.btm for TCMD? Support 4
vefatica Console not redrawn in BTM or with multiple commands Support 4
Joe Caverly Embedding an .EXE (or other file) into a .BTM Support 8
Charles S. Roaten Problems with TCSTART.BTM Support 1
P Kill all other instances of tcc from a btm batch file Support 2
C TCC 26 BATCOMP BTM problems? Support 5
B IF command problem in tcexit.btm Support 9
vefatica WAD DIR.BTM? Support 11
vefatica BTM, elevated, console window caption? Support 4
I BTM slower than BAT? Support 14
D btm file command line augments comparing for string or math. Support 12
D check for network tcstart.btm and load if newer Support 3
Craig Fitzgerald Problems using tcstart.btm Support 3
vefatica Installer sets BTM associations wrongly Support 4
O I cannot use links to .btm files Support 5
C NE1 have BTM to remove %appdata\JP Software\ etc... Support 0
C interesting TCStarts.btm Support 2
JohnQSmith ALIAS /R in TCSTART.BTM Support 9
Paul Berwanger BTM Bugs Support 2
M Drag and Drop for .BTM scripts Support 10
D WAD START /ELEVATED "Title" /PGM "job.btm" Support 6
C How to? run a BTM in elevated, inv tcc tab window Support 9
Roedy How to? Understanding BTM file properties Support 0
Fross GetOpt.btm Support 0
Roedy BTM file encoding Support 13

Similar threads