TC Command line and cmd

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
saper_2
Junior Member
Junior Member
Posts: 3
Joined: 2013-09-22, 19:25 UTC
Location: PL

TC Command line and cmd

Post by *saper_2 »

Hi,

I have in windows cmd defined my "custom startup script" (for which AV likes to complain :lol: ), in this script I have set %path% that add my dir with extra tools (like: sha256sum, dd, touch, ls...).

I do remember until some version that when I typed command e.g.: "touch readme.txt" TC spawned a cmd and run command inside, so my script got loaded, and it worked, but that changed at some version (don't remember which one) :cry: ... I used to type just "touch readme.txt" and I got readme.txt in directory, now I have to open cmd and ...

Maybe there is somewhere a option to change this "back"?

Adding my custom-tool-path to system-wide (or user) %PATH% is out of option.


OT:
For interested - to setup custom startup script:
Create value type: "string" name: "Autorun" in key: "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command"

And here is my script:

Code: Select all

@echo off
rem LS : YaY
doskey ls=ls --color $*
doskey ll=ls -la --color $*

rem Finally set path to sha256sum and ls ^u^
set PATH=%PATH%;d:\projects\bin;

echo Custom tools has been loaded.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: TC Command line and cmd

Post by *MVV »

Well, actually if you just type a command into TC command line and press Enter, it executes directly without starting cmd.exe, and cmd.exe is only used when you press Ctrl+Enter. But this behaviour is unchanged for years.

If you run your command with Shift+Enter, TC starts cmd.exe and passes the command to it, and it doesn't pass /D switch (the only documented way to prevent cmd.exe to execute autorun commands).

So if you want to run your touch by Enter from TC command line, you have a number of ways:
1. Define an alias for this tool in TC to run it by short name.
2. Install Autorun plugin and configure it to extend TC's PATH environment variable to enable searching for executables in additional directories within TC and its child processes.
3. Extend your PATH variable for your entire user profile in Windows settings to enable searching for executables in additional directories for all applications (you can open corresponding dialog via rundll32 sysdm.cpl,EditEnvironmentVariables command).
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: TC Command line and cmd

Post by *Hacker »

MVV,
cmd.exe is only used when you press Ctrl+Enter
Shift-Enter ;)

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
saper_2
Junior Member
Junior Member
Posts: 3
Joined: 2013-09-22, 19:25 UTC
Location: PL

Re: TC Command line and cmd

Post by *saper_2 »

Hi,

Thanks for replays :-)

@MVV,
I did not know about shift+Enter (thx Hacker) , but it leave cmd open , half-almost-working....
ad1. hmmm, I'd need to do for each tool inside my custom bin-dir (that's PITA to set'up and keep up-to-date)
ad3. I did write, this is out of option, because inside my bin-dir are dll's linked to those from-linux-cross-compiled-tools, and this once caused me a lot of annoying troubles :|
ad2. Can't find on: https://www.ghisler.com/plugins.htm .
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: TC Command line and cmd

Post by *Stefan2 »

Maybe start all together from a batch?

@ECHO OFF
SET PATH=%PATH%;X:\xxx
START "" "D:\rive\Path to\TC\tc.exe



Or use:
SET "LNX=X:\xxx"
-or-
SUBST L: X:\xxx

In TC use %LNX%\path\xy\abc.exe -OR- L:\path\xy\abc.exe




 
Post Reply