AutoHotkey: Refresh the treeinfo.wc of certain drives

From TotalcmdWiki
Revision as of 13:25, 24 September 2005 by Stance (talk | contribs) (Real interwiki de)
Jump to navigation Jump to search

You got some real huge disks and want to refresh the treeinfo.wc overnight, thus you need a program you can put into the scheduler.

This script uses the code for the cm_gotodriveX command to switch to all drives you want to refresh the treeinfo.wc. So you may add some drives or alter the driveletters. The 2063 code means 'open Drive c:\', 2064 means 'open drive d:\' and so on. In my example the trees of drives c:\ d:\ e:\ and i:\ are refreshed.


;start Totalcmd.exe
run "Your\Path\to\\totalcmd.exe" 
;wait until TC-window has opened WinWaitActive, ahk_class TTOTAL_CMD
{ ;open a new tab PostMessage, 1075, 3001, , , ahk_class TTOTAL_CMD ;open drive c:\ PostMessage, 1075, 2063, , , ahk_class TTOTAL_CMD ;wait until the filewindow is read sleep, 1000 ;Open the treewindow PostMessage, 1075, 500, , , ahk_class TTOTAL_CMD ;refresh tree send {F2} ;close the treewindow send {Enter} ;wait until the window has closed WinWaitClose, ahk_class TCHANGETREEDLG
;open next drive PostMessage, 1075, 2064, , , ahk_class TTOTAL_CMD sleep, 1000 PostMessage, 1075, 500, , , ahk_class TTOTAL_CMD send {F2} send {Enter} WinWaitClose, ahk_class TCHANGETREEDLG
;open next drive PostMessage, 1075, 2065, , , ahk_class TTOTAL_CMD sleep, 1000 PostMessage, 1075, 500, , , ahk_class TTOTAL_CMD send {F2} send {Enter} WinWaitClose, ahk_class TCHANGETREEDLG
;open next drive PostMessage, 1075, 2069, , , ahk_class TTOTAL_CMD sleep, 1000 PostMessage, 1075, 500, , , ahk_class TTOTAL_CMD send {F2} send {Enter} WinWaitClose, ahk_class TCHANGETREEDLG
;close the Tab PostMessage, 1075, 3007, , , ahk_class TTOTAL_CMD
;make TC active WinActivate, ahk_class TTOTAL_CMD ;and when active WinWaitActive, ahk_class TTOTAL_CMD ;send the Close TC command PostMessage, 1075, 24340, , , ahk_class TTOTAL_CMD
}

return


Save this script with extension *.ahk (e.g. refresh.ahk), install Autohotkey and call the script with Windows scheduler.

You may remove all lines beginning with a ";", because these are only comments to understand what the script does.



------
Back to AutoHotkey