LOG entry for TCMD/TCC command line

Apr 2, 2011
1,429
10
54
North Carolina, USA
Is it possible to log how TCMD/TCC was started, usually if it's "Run as Administrator" and if there was a "Start In" or CD /D entry? I looked at the LOGS already generated (I have all available LOG entries in OPTION set) and nothing is looking close to my answer.

Might a plugin be created for this need?

TCC 19.10.51 x64 Windows 7 [Version 6.1.7601]
TCC Build 51 Windows 7 Build 7601 Service Pack 1
 
May 20, 2008
11,388
99
Syracuse, NY, USA
Rex will no doubt know more, but I doubt TCC can be aware of any "Start In" entry anywhere; I believe that just tells TCC's parent what directory to specify when it (the parent) creates the TCC process. As for "CD /D", I believe TCC's start-up command line is available (not sure how) to TCSTART.BTM. From TCSTART, you could log start-up command lines and also check the _ELEVATED variable and log TCC's being run as admin.
 
May 20, 2008
11,388
99
Syracuse, NY, USA
You can try %@PIDCOMMAND[%_PID]. I don't think it can be guaranteed to always return correct info, but it's worth a shot.
And, according to the help,
With the exception of some initialization switches, the entire startup command line passed to TCC is available to TCSTART as batch file parameters (%1,%2, etc.).

And if you use SYSUTILS, @PSTAT will give it to you.
Code:
v:\> echo %@pstat[.,c]
g:\tc19\tcc.exe /q
 
Jan 12, 2014
423
7
Switzerland, SO
Interesting! If I click on thet link in the forum post, Firefox does not (even try to) connect to lucky. OTOH, if I copy the link from the post to FireFox's location bar, it retrieves the file. Maybe that's something for Rex to look into.
It's because the link itself has no ":" after "ftp" ...
 
May 20, 2008
11,388
99
Syracuse, NY, USA
It's been a couple of years since we last discussed this one.

XenForo's been upgraded more than once since then, but the issue remains....
Yeah, I remembered it too and did a little Googling. Xenforo says it's by design and for security. Considering all it can do (Java, Flash, drag in unlimited third party crap, ...) HTTP seems more dangerous than FTP (which, after all, just transfers files).
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,447
88
Albuquerque, NM
prospero.unm.edu
Will it give similar details if it was TCMD and not TCC that was started?

AFAIK, either @PSTAT or @PIDCOMMAND takes a PID to specify the process. Just pass %_PID to get info on the current TCC.

Take Command's PID is harder to figure. %_PPID might be Take Command, but then again it might not. (TCC might have been launched by Take Command, or by Explorer. Or by another instance of TCC, or by CMD.EXE, which might itself in turn have been launched by any of the above.... I suppose you could walk back the chain with @PPID, examining each process with @PSTAT or @PIDCOMMAND until you find one which isn't TCC.EXE or CMD.EXE. That process might or might not be TCMD.EXE.... (And to confuse matters further, you can attach console programs to Take Command manually; these will not have TCMD as an ancester, unless they do.)
 
Apr 2, 2011
1,429
10
54
North Carolina, USA
I use the attached registry.reg.txt exported registry data to specify Elevated status and the directory to open TCMD in. What I am looking for is basically:

C:\Program Files\Jpsoft\TCMD19_x64\tcmd.exe /d "C:\Users\Galloway\Desktop\HoldMe\"

assuming I had RMCed on the HoldMe folder on the desktop....
 

Attachments

  • directory.reg.txt
    208 bytes · Views: 99
May 20, 2008
11,388
99
Syracuse, NY, USA
Will it give similar details if it was TCMD and not TCC that was started?
With "." (specifying the current process) it will always give TCC's command line. As Charles pointed out you'll have to give it TCMD's PID if you want TCMD's command line.

Does that way of starting TCMD elevated result in a UAC prompt? There's a nice way to do it without the prompt. Make a scheduled task ... no schedule, but run-on-demand and with the highest privileges. Then start the task (named TCMDAdmin) with the likes of
Code:
schtasks.exe /run /tn TCMDAdmin
. I even used EDITBIN to make a GUI version of SCHTASKS.EXE so it wouldn't pop up a momentary console.
 
  • Like
Reactions: Charles G
Apr 2, 2011
1,429
10
54
North Carolina, USA
echo %@PIDCOMMAND[%_PID]

does not seem to be what I want. I want to see the full command that started TCMD. And I start TCMD by the following reg key data:

"C:\Program Files\JPSoft\TCMD21\tcmd.exe" /D "%L"

so if I right clicked on Folder1 on my desktop, it would return

"C:\Program Files\JPSoft\TCMD21\tcmd.exe" /D "%UserProfile%\Desktop\Folder1"

but with %UserProfile% expanded....
 
May 20, 2008
11,388
99
Syracuse, NY, USA
I don't know about the rest of explorer, but I just started TCMD from Start\Run with this command:
Code:
g:\tc21\tcmd /d "%UserProfile%"
And in its TCC tab I see
Code:
v:\> echo %@pidcommand[%@pid[tcmd.exe]]
"G:\tc21\tcmd.exe" /d "C:\Users\vefatica"

Note that somewhere, quotes were added to the tcmd.exe path ... but %UserProfile% was expanded.
 
Similar threads
Thread starter Title Forum Replies Date
vefatica v26 exception log gone crazy Support 6
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
DrusTheAxe Runaway TCC.exception.log filling drive Support 5
Joe Caverly tcc.exception.log Support 3
rps LOG /a (all) with Atl-F2 Support 2
C Documentation default location for LOG files Support 21
P LOG command behavior Support 3
rps How to? Alias/Command line use of *log on/off Support 2
C b34 Installer leaves LOG in %LocalAppData%\Temp\ Support 1
vefatica Strange tcc.exception.log Support 7
Jay Sage WAD Issues with LOG Command Support 4
vefatica TCC.LOG Support 4
D How to? How to show variables expanded in the log tab Support 3
M How to? Start a program on log on elevated abovenormal Support 5
F Dating a log Support 14
C TPipe Log file not correct Support 1
A How to? Set up a log file for all command output Support 3
vefatica aemail\datamystic.log? Support 1
M How to? Save the session log from a batch file? Support 5
S Documentation LOG command Support 0
dcantor Documentation Help error for command LOG Support 0
S Log and foldermonitor problems Support 3
S LOG within a batch file Support 1
jfalch WAD internal "which" should check for FILEEXIST when using AppPaths entry Support 8
T COPY command entry Support 7
S WAD %_do_errors does not report errors when loop control variable type is not directory entry Support 1
S Index entry Support 0
Jay Sage Glitch in Whatsnew Help Entry Support 0
vefatica No help index entry for WINDOW Support 4
D TCMD /X option Support 1
vefatica TCMD hides itself! Support 3
vefatica Tray min'd TCMD and ACTIVATE Support 6
C How to? starting TCC/TCMD v25 Support 2
CWBillow TCC and TCMD in Powershell Support 6
kb6ojs How to? "Specified Account Already Exists" error installing TCMD v27 Support 12
CWBillow TCMD Colors Support 8
Jay Sage Issues With TCMD File Explorer Support 0
C Last TCMD that supports win 7? Support 5
gentzel TCMD background color confusion Support 6
R Upgrade TCMD 19 to TCC 26 Support 1
Alpengreis Remaining TCMD background process (v26) ... Support 19
S Windows Server version not being detected correctly in TCMD 26RC2 Support 9
G TCMD crash when copy Support 3
Joe Caverly DrawVLine results different in TCMD tab and detached TCC Support 11
Alpengreis [TCMD v25.00.24] Small space problem with the DE translation in Prefs-GUI Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
Jay Sage TCMD Crashes with "tctoolbar /c /r file" Support 5
nikbackm TCMD 25 - Unregister older TCMD version Support 2
G Documentation on TCMD.INI Support 9
R New Clear Buffer in TCMD Home Menu Support 2

Similar threads