clink
clink copied to clipboard
Clink not injected for batch files (bat/cmd)
When I open cmd.exe
, Clink is properly injected and executed (using the AutoRun
registry key).
But when I directly run a batch file (by executing a bat
or cmd
file), it's not being injected. Is there any way to make it work even for batch files, please?
It has been almost a year since I posted my issue and still no answer...?
bat files are executed by a cmd.exe instance started with a "/c" argument. IIRC, clink will not inject itself in this case. Perhaps changing in the registry how a bat in opened to be explicitly cmd.exe /k "%1" %*
Thank you @garoto but I don't need it anymore. Let me explain it:
I had a custom prompt defined in an environment variable or in the registry (doesn't matter where) where I have used ANSI color codes extensively. When I ran a console, Clink injected itself and interpreted the ANSI codes but when I ran a batch, the output was full of "garbage" because of uninterpreted ANSI codes. That's why I was looking for a way to inject Clink to a console started by a batch.
Since I couldn't manage to achieve that, I simply removed all ANSI codes from the prompt defined in the environment variable or in the registry and defined my colored prompt in a Clink's LUA script instead. This way I have a proper monochromatic prompt for batches and colored prompt in the regular console.
If anyone interested, this is my prompt definition for Clink. There are also definitions for a prompt with the same features and look for Powershell, Bash, and Zsh.
I experienced the same issue, at the moment I'm using Clink v1.0.0.a1 (was the same with 0.4.9)
I came here to report the same issue, was not going to necro this thread, but .. seeing someone just a day ago so I do not feel as bad. The change above "cmd.exe /k "%1" %*" do you have the key location available ? Would save me a bit of time looking. I tried shortcuts and a few other this with no luck. Thank you,
I made a mistake on syntax, it does seem to work this way
It seems to work, but the settings are not being applied that work in another window using START CALL blahblah.bat I will play with it some more
Here are some pictures, I can create another case/thread if feeling the need but since stemming from the change above I figured I would continue from here manually starting things and going /C then doing it that way it works. When add in the /k although shows it attached settings dont seem to apply.
I am sure this is user error, me being that user but some guidance and a tip or to would be helpful.
After I CTRL-C in the most forefront window (the one creating mutations for my fuzzer) I am left with the CTRL+C.
I then "X" it out and again I am left with the CTRL+C. In the background towards the left you will see the option 2. If I run START CALL cmd.exe from the batch file and then run CLINK SET, I again get the same settings.
Perhaps I am not understanding the functionality but I was under impression these would be suppressed.
Thanks
Hello guys,
I'm actually trying to achieve this for Robot Framework in a Jenkins pipeline. It's working locally if I manually start command line and then execute my .bat file. But if I execute first my .bat file It does not work...
I don't see how I could setup my windows to load clink before the .bat script...
I tried:
start cmd.exe /k "my_bat_file.bat"
It does not work...
Do you know if there is a workaround to use clink with Jenkins?