By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!set assoc=%@assoc[.btm]
echo %@regcreate[HKCR\%assoc\shell\runas\command]
echo %@regset[HKCR\%assoc\shell\runas\command\,REG_SZ,"%_cmdspec" /C "%%1" %%*]
@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
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