#T::
 ifwinnotexist ahk_class TTOTAL_CMD
 {
 run C:/totalcmd/totalcmd.exe
 winwait ahk_class TNASTYNAGSCREEN
 winactivate ahk_class TNASTYNAGSCREEN
 winwaitactive ahk_class TNASTYNAGSCREEN
 ControlGetText, OutputVar, TPanel1
 ControlGetText, OutputVar, TPanel2 ;   新版可能改成window4了, it is wierd here. If get text of TPanel2 at first time, the text of TPanel1 will be return
 if ErrorLevel   ; if something wrong
    MsgBox, The window does not exist.
 else
    send %OutputVar%
 }
 else
 {
    ifwinnotactive ahk_class TTOTAL_CMD
    {
        winactivate ahk_class TTOTAL_CMD
        winwaitactive ahk_class TTOTAL_CMD
    }
 }
 return

另一个脚本方案

http://thouls.lofter.com/post/20f634_d78725

用AutoHotkey实现Total Commander自动点击未注册提示窗口123启动程序

Total Commander对未注册用户还是挺厚道的,除了要求每次启动时点击未注册提示窗口的随机数字外没其它限制。不过每次都点也挺麻烦的,不小心点错了数字的话程序还会自动退出。于是我写了段AutoHotkey脚本来实现提示窗口的自动点击。顺便集成了之前写的修改Total Commander标题栏的代码。

安装AutoHotkey后,新建一个脚本文件,输入以下内容:

Loop                 
{                 
   IfWinExist, ahk_class TTOTAL_CMD   
{           
   WinGetTitle, Title, ahk_class TTOTAL_CMD               
   StringMid, N_Title, Title, 1, 20 ;保留TC的版本号信息           
   WinSetTitle, %N_Title%  - 注册名称 ;黑体部分可以换成自己想要的名字      
} 
       
   IfWinExist, ahk_class TNASTYNAGSCREEN                 
   {                 
      WinGetText, Content, ahk_class TNASTYNAGSCREEN ;获取未注册提示窗口文本信息                 
      StringMid, Num, Content, 10, 1 ;获取随机数字                 
      ControlSend,, %Num%, ahk_class TNASTYNAGSCREEN ;将随机数字发送到未注册提示窗口                 
   }                 
  sleep, 250 
}                 
保存后将脚本文件的快捷方式添加到Windows启动项,运行后即实现提示窗口的自动点击启动。



ps: 
Content,"`n")
 controlsend,, % arr[1],ahk_class TNASTYNAGSCREEN