shaamaan Posted August 6, 2004 Posted August 6, 2004 i have seen several utilities to do this function, but this one in autoit is realy super short and easy to understand, so check it out! if processexists("TOTALCMD.EXE") then processclose("TOTALCMD.EXE") run("Totalcmd.exe") else msgbox(0, "Error", "Total Commander is not run!") endif
Lazycat Posted August 7, 2004 Posted August 7, 2004 You on the right way I'm for a long time use Autoit for making additions for TC, that I compile into my own private distributive for using in my company. This is my version of script: Opt("WinTitleMatchMode", 2) WinClose("Total Commander") If WinExists("Total Commander") Then ProcessClose("totalcmd.exe") Run(@ScriptDir & "\..\..\totalcmd.exe") That other example, directs left panel into system folders, no matter where windows installed. If $CmdLine[0] = 0 then exit Select Case $CmdLine[1] == "system" GoToDir (@SystemDir) Case $CmdLine[1] == "mydoc" GoToDir (@MyDocumentsDir) Case $CmdLine[1] == "desktop" GoToDir (@DesktopDir) Case $CmdLine[1] == "startmenu" GoToDir (@StartMenuDir) Case $CmdLine[1] == "favorites" GoToDir (@FavoritesDir) Case $CmdLine[1] == "sendto" GoToDir (@UserProfileDir & "\SendTo") Case $CmdLine[1] == "programs" GoToDir (@ProgramsDir) Case $CmdLine[1] == "startup" GoToDir (@StartupDir) Case $CmdLine[1] == "tempint" GoToDir (@UserProfileDir & "\Local Settings\Temporary Internet Files") Case $CmdLine[1] == "appdata" GoToDir (@UserProfileDir & "\Local Settings\Application Data") Case Else Exit EndSelect Func GoToDir ($sDir) Opt("RunErrorsFatal", 0) $tc_path = @ScriptDir & "\..\..\totalcmd.exe " Run($tc_path & '/L="' & $sDir & '" /O') EndFunc Maybe we need to make topic with ideas and addons for TC? Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
shaamaan Posted August 9, 2004 Author Posted August 9, 2004 You on the right way I'm for a long time use Autoit for making additions for TC, that I compile into my own private distributive for using in my company. This is my version of script: Opt("WinTitleMatchMode", 2) WinClose("Total Commander") If WinExists("Total Commander") Then ProcessClose("totalcmd.exe") Run(@ScriptDir & "\..\..\totalcmd.exe") - is it not better and more sure to use processes? - it is expressly needed a topic about tc addons!
Lazycat Posted August 10, 2004 Posted August 10, 2004 - is it not better and more sure to use processes?It's more sure, but TC doesn't save configuration if it's process closed. This is not good. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
shaamaan Posted August 10, 2004 Author Posted August 10, 2004 It's more sure, but TC doesn't save configuration if it's process closed. This is not good. <{POST_SNAPBACK}>under configuration you are thinking the pats in tc windows? if yes, then i have idea: check tc window in autoit_spy and from "Visible Window Text " you can find and save (stringsplit...) the pats to the tc ini configuration
Lazycat Posted August 11, 2004 Posted August 11, 2004 under configuration you are thinking the pats in tc windows?Not only, new added tabs also don't save. Sure something also, because some settings TC save instantly, but some not.if yes, then i have idea: check tc window in autoit_spy and from "Visible Window Text " you can find and save (stringsplit...) the pats to the tc ini configurationYou think this is a "simple and safe" way? When I make this piece of code I think so: first try to close program with right way, so all settings will save. It safe enough until you have not other windows with the "Total Commnder" in header. ProcessClose was used only as "emergency exit" for rare cases if TC remain.BTW our both scripts doesn't take attention if more then one copy of TC is open. Although I usually don't open more then one copy... Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
shaamaan Posted August 11, 2004 Author Posted August 11, 2004 Not only, new added tabs also don't save. Sure something also, because some settings TC save instantly, but some not. You think this is a "simple and safe" way? When I make this piece of code I think so: first try to close program with right way, so all settings will save. It safe enough until you have not other windows with the "Total Commnder" in header. ProcessClose was used only as "emergency exit" for rare cases if TC remain.<{POST_SNAPBACK}>- yes, new tabs save is problem... but have you try to find out if tc saves new tabs in some other file (not in wincmd.ini)? BTW our both scripts doesn't take attention if more then one copy of TC is open. Although I usually don't open more then one copy... <{POST_SNAPBACK}>- with new tabs ability you dont have any reason to open more then one copy of tc, i think...
Lazycat Posted August 11, 2004 Posted August 11, 2004 but have you try to find out if tc saves new tabs in some other file (not in wincmd.ini)?No, they are in the wincmd.ini. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
shaamaan Posted August 11, 2004 Author Posted August 11, 2004 No, they are in the wincmd.ini. <{POST_SNAPBACK}>- then, can you not save it to the another ini file before closing tc?
Lazycat Posted August 12, 2004 Posted August 12, 2004 Hmm... can you explain? Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
shaamaan Posted August 22, 2004 Author Posted August 22, 2004 Hmm... can you explain? <{POST_SNAPBACK}>- follow this points: 1.) read the ini value of tabs (with "inirad") 2.) write this value to some ini file (with "iniwrite") 3.) close totalcmd process (with "processclose") 4.) write saved tabs values to the wincmd.ini 5.) start totalcmd again
Lazycat Posted August 22, 2004 Posted August 22, 2004 IMO too complex All the more TC not save information somewhere instead wincmd.ini. Yes, you can save tabs into file (if you give command for save and select file before ), then parsing result file... but again, it too complex and I not see real advantages of it. If you think that using window title not safe - it possible to use classname of window (TTOTAL_CMD), which is unique for TC. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
shaamaan Posted September 3, 2004 Author Posted September 3, 2004 IMO too complex All the more TC not save information somewhere instead wincmd.ini. Yes, you can save tabs into file (if you give command for save and select file before ), then parsing result file... but again, it too complex and I not see real advantages of it. If you think that using window title not safe - it possible to use classname of window (TTOTAL_CMD), which is unique for TC. <{POST_SNAPBACK}>yes, it is complex... classname is a good alternative to process...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now