Code: Select all
# Open Quick View on left panel
ShellExec "%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe" "/ef tcm(104)"
Moderators: Hacker, petermad, Stefan2, white
Code: Select all
# Open Quick View on left panel
ShellExec "%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe" "/ef tcm(104)"
cool, please let us know when you implement such a "onlystartifnotrunning" parameterMVV wrote:You may start via plugin any apps that you start from batch. Just use ShellExec command like this:
Currently plugin can't check if some app is running (only via bat file that is started from plugin), but it was requested (and will be realized as plugin I think).Code: Select all
# Open Quick View on left panel ShellExec "%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe" "/ef tcm(104)"
You could use AutoHotkey for the latter.tcvol wrote:hi there
can you please post a few more examples to get more ideas of the .cfg file?
i have quite a lot of .cmd before/while tc starts, which are probably still needed, since tc has to be mounted and started from within a truecrypt volume and i need the information before tc is started.
but i think i could migrate the following things:
path to be synced (dropbox)
path not to be synced (tcmd addons)
start 3rd party apps if not already running
cheers
Code: Select all
ShellExec /ec %USERPROFILE%\Documents\AutoHotkey\TC_StartApps.ahk
Code: Select all
; TC_StartApps.ahk
if(!WinExist("Untitled ahk_class Notepad") )
Run, notepad.exe
Code: Select all
# Enables MoveButton functionality
# Âêëþ÷àåò ôóíêöèîíàë MoveButton
#LoadLibrary Plugins\Autorun_MoveButton.dll
#MoveOptionsButton MOVE_LEGACY
# Adding current TC path to PATH environment variable
# Äîáàâëÿåò ê ïåðåìåííîé îêðóæåíèÿ PATH òåêóùóþ ïàïêó TC
SetEnv /A /EV AUTORUN_OSVERSION %AUTORUN_OSVERSION%
SetEnv /A /EV COMMANDER_ADDONS %COMMANDER_PATH%\..\..\tcmdaddons
SetEnv /A /EV COMMANDER_WS %COMMANDER_PATH%\..\..\tcmdws
SetEnv /A /EV COMMANDER_SCRIPTS %COMMANDER_PATH%\.scripts
SetEnv /EV cut %COMMANDER_PATH%\ess\util\gnu\cut.exe
SetEnv /EV head %COMMANDER_PATH%\ess\util\gnu\head.exe
SetEnv /EV ssed %COMMANDER_PATH%\ess\util\gnu\ssed.exe
SetEnv /EV tail %COMMANDER_PATH%\ess\util\gnu\tail.exe
#utils
#SetEnv /AD /EV cut %COMMANDER_PATH%\ess\util\gnu\cut.exe
#SetEnv /AD /EV handle %COMMANDER_PATH%\ess\sys\sysinternals\pstools\handle.exe
#SetEnv /AD /EV head %COMMANDER_PATH%\ess\util\gnu\head.exe
#SetEnv /AD /EV pskill %COMMANDER_PATH%\ess\sys\sysinternals\pstools\pskill.exe
#SetEnv /AD /EV pslist %COMMANDER_PATH%\ess\sys\sysinternals\pstools\pslist.exe
#SetEnv /AD /EV pwd %COMMANDER_PATH%\ess\util\gnu\pwd.exe
#SetEnv /AD /EV ssed %COMMANDER_PATH%\ess\util\gnu\ssed.exe
#SetEnv /AD /EV tail %COMMANDER_PATH%\ess\util\gnu\tail.exe
#SetEnv /AD /EV wc %COMMANDER_PATH%\ess\util\gnu\wc.exe
#SetEnv /AD /EV setx %COMMANDER_PATH%\ess\util\cli\setx.exe
# Enables showing of administrative shares
# Âêëþ÷àåò îòîáðàæåíèå àäìèíèñòðàòèâíûõ øàð
#SendCommand cm_AdministerServer
#set ditto db to expanded tc workspace\ditto.db
#ini write
#IniWrite %commander_path%\ess\util\ditto\Ditto.Settings Ditto DBPath3 %commander_ws%\ditto.db
#fix favmenu path to tc
IniWrite /EV %commander_path%\ess\tcmd\favmenu\config.ini TcFavMenu tcExe %commander_path%\TOTALCMD.EXE
IniWrite /EV %commander_path%\ess\tcmd\favmenu\config.ini TcFavMenu tcIni %commander_ws%\dirmenu.ini
#call tc startup script
#ShellExec "%commander_scripts%/sys/pause.cmd"
ShellExec /EV %commander_scripts%/autotc/startup.3.cmd
Code: Select all
@echo off
REM set logging file
set log=%TEMP%\%~n0.log
date /T > "%log%"
time /T >> "%log%"
REM clean up tasks
REM clear captchas of jdownloader because of syncing
if exist "%commander_path%\ess\www\jdownloader\captchas\*.*" (
echo [i] deleting "%commander_path%\ess\www\jdownloader\captchas\*.*" >> "%log%" && del "%commander_path%\ess\www\jdownloader\captchas\*.*" /Q
)
echo @echo off > "%TEMP%\%~n0.run.cmd"
REM checking running apps
REM apps.ini
for /f "usebackq delims=* tokens=1,2" %%a in ("%~dp0apps.ini") do (
echo [i] calling "%commander_path%\.scripts\sys\exist.exe" %%a "%%b\%%a" "%%b" >> "%log%" && echo "%commander_path%\.scripts\sys\exist.exe" %%a %%b\%%a %%b >> "%TEMP%\%~n0.run.cmd"
)
if exist "%TEMP%\%~n0.run.cmd" call "%TEMP%\%~n0.run.cmd"
REM tc pre tasks workspace
REM copy local.bar if it doesn't exist locally
if not exist "%commander_ws%\local.bar" (
echo [i] "%commander_ws%\local.bar" does not exist, copying from "%commander_path%\profiles\my\bars\Bar_02.bar" >> "%log%" && copy "%commander_path%\profiles\my\bars\Bar_02.bar" "%commander_ws%\local.bar"
)
REM checking tc hotlist
if exist "%commander_ws%\dirmenu.ini" (
echo [i] checking entries of "%commander_ws%\dirmenu.ini" >> "%log%"
echo [i] exporting remotestart to remoteend to "%commander_ws%\dirmenu.ini.combined" >> "%log%" && "%ssed%" -n "/;remotestart/,/;remoteend/p" "%commander_path%\profiles\my\dirmenu.ini" > "%commander_ws%\dirmenu.ini.combined"
echo [i] exporting localstart to localend to "%commander_ws%\dirmenu.ini.local" >> "%log%" && "%ssed%" -n "/;localstart/,/;localend/p" "%commander_ws%\dirmenu.ini" > "%commander_ws%\dirmenu.ini.local"
"%tail%" -n 2 "%commander_ws%\dirmenu.ini.combined" | find "=" | "%cut%" -d = -f 1 | "%ssed%" -e "s/[^0-9]//g" > "%temp%\%~n0.endremote.nfi"
"%head%" -n 2 "%commander_ws%\dirmenu.ini.local" | find "=" | "%cut%" -d = -f 1 | "%ssed%" -e "s/[^0-9]//g" > "%temp%\%~n0.startlocal.nfi"
setlocal enabledelayedexpansion
set /p endremote=<"%temp%\%~n0.endremote.nfi"
set /p startlocal=<"%temp%\%~n0.startlocal.nfi"
set /a localconst=!startlocal!-1
echo [d] endremote: !endremote! startlocal: !startlocal! localconst: !localconst! >> "%log%"
echo [i] copying combined "%workspace%\dirmenu.ini.combined" to "%commander_ws%\dirmenu.ini" && copy "%commander_ws%\dirmenu.ini.combined" "%commander_ws%\dirmenu.ini"
echo ;localstart >> "%commander_ws%\dirmenu.ini"
for /f "usebackq tokens=1,2 delims==" %%a in ("%commander_ws%\dirmenu.ini.local") do (
echo %%a | "%ssed%" -e "s/[^0-9]//g" > "%temp%\%~n0.temp1.nfi"
echo %%a | "%ssed%" -e "s/[0-9]//g" > "%temp%\%~n0.temp2.nfi"
set /P temp1=<"%temp%\%~n0.temp1.nfi"
set /P temp2=<"%temp%\%~n0.temp2.nfi"
set temp2=!temp2:~0,-1!
set /A calc1=!temp1!-!localconst!+!endremote!
echo [i] appending to final hotlist: !temp2!!calc1!=%%b >> "%log%" && echo !temp2!!calc1!=%%b >> "%commander_ws%\dirmenu.ini"
)
echo [i] appending ;localend to final hotlist >> "%log%" && echo ;localend >> "%commander_ws%\dirmenu.ini"
)
if not exist "%commander_ws%\dirmenu.ini" echo [i] "%commander_ws%\dirmenu.ini" does not exist, copying from "%commander_path%\profiles\my\dirmenu.ini" >> "%log%" && copy "%commander_path%\profiles\my\dirmenu.ini" "%commander_ws%\"
if exist "%TEMP%\%~n0.*.nfi" echo [i] deleting "%TEMP%\%~n0.*.nfi" >> "%log%" && del "%TEMP%\%~n0.*.nfi"
not sure if you mean this .. but this workssgp wrote:I think ShellExec will only work if the Windows shell is running (granted that's 99.9% of cases) and if a file association for .ext is stored in the System Registry, which is not guaranteed, especially since tcvol is running a portable installation.
I have defined all my portable apps as TC portable associations. Can AHK look up a file extension and return the command line(s) that TC associates to open that extension?
Code: Select all
*.ahk
"%commander_path%\ess\util\autohotkey\AutoHotkey.exe" "%1"
No, this isn't waht I meant with my question. I meant can AHK read TC internal associations section and check if a given file is associated with some existing templates, and return a menu of such templates.tcvol wrote:not sure if you mean this .. but this workssgp wrote:I think ShellExec will only work if the Windows shell is running (granted that's 99.9% of cases) and if a file association for .ext is stored in the System Registry, which is not guaranteed, especially since tcvol is running a portable installation.
I have defined all my portable apps as TC portable associations. Can AHK look up a file extension and return the command line(s) that TC associates to open that extension?
internal associationsCode: Select all
*.ahk "%commander_path%\ess\util\autohotkey\AutoHotkey.exe" "%1"
readme_en.txt wrote:1.6 beta 13
+ added %ERROR% variable functionality
+ added commands SystemParametersInfo, GetSysColor into SysInfo plugin
+ basic functions for working with strings
1.6 beta 12
+ added API for С++
+ added Sysinfo plugin
1.6 beta 11
+ command RegRead
1.6 beta 10
+ /WAIT parameter for ShellExec
+ New keyword Pragma for directives
1.6 beta 9
+ FileExist function
1.6 beta 7
+ ability to make actions when TC closing
1.6 beta 6
+ added full-fledged comparison expressions
+ special functions for comparisons
+ Process plugin (working with processes)
1.6 beta 5
* fully changed plugin API
+ %AUTORUN_TCPID% constant added
+ added Windows 8 detection
totalcmd.net wrote:Version 2.0.1
- fixed MoveButton plugin with TC 8.50 beta
Version 2.0.0
+ added x64 version
+ ability to make actions when TC closing
+ added full-fledged comparison expressions
+ commands for working with registry
+ Process plugin (working with processes)
+ Sysinfo plugin (retrieve extended system info)
* fully changed plugin API
* changed help file format to HTML Help
Code: Select all
IF FileExist %COMMANDER_PATH%\config\%COMPUTER_NAME%-Dirmenu.ini Then ...
Endif
Code: Select all
IF FileExist "%COMMANDER_PATH%\Data\1.ini" Then
IniWrite "%COMMANDER_PATH%\Data\1.ini" "sec" "key" "yes"
Else
IniWrite "%COMMANDER_PATH%\Data\1.ini" "sec" "key" "no"
Endif
Code: Select all
LoadLibrary Plugins\Autorun_Process.dll
Set myFirstTool "%COMMANDER_PATH%\Tools\Tool1\tool1.exe"
ProcessExist /F alreadyRunning "%myFirstTool%"
If %alreadyRunning% = 0 Then
ShellExec "%myFirstTool%"
# start other tools
Endif
Code: Select all
LoadLibrary Plugins\Autorun_Process.dll
ProcessCount /F numInstances "%COMMANDER_EXE%"
If %numInstances% = 1 Then
# start all tools here
Endif