-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Startup calls: C:\WINDOWS\System32\find /i "\cmd.exe" which fails due to Avecto #2744
Comments
Allright, I found the script that makes these calls, it's in vendor\lib\lib_base.cmd.
Removing that code removes the Avecto alert. But one of my questions is still valid: What exactly are these commands supposed to do? When I run the first command manually, and I allow to run it, it takes forever. This can impossibly be the intent. |
I'm not the developer, but I thought I'd chime in. These commands are supposed to detect the currently running command line interpreter, which is most likely the Now, the C:\WINDOWS\system32\cmd.exe In order to detect this, we can pipe the output of this variable to the This will find the substring "\cmd.exe" in the comspec variable, and when present set the Additionally, the full path to As you can see, the If you are not using the TCC/LE alternative command line interpreter, this shouldn't matter and you can safely edit the script to remove the This detection is being done to disable the clink shell and cmder aliases due to incompatibility with the TCC/LE software. (introduced in #1959 and #1806) I'm not sure how Avecto parses the passed parameters to As an alternative, we can parse the @echo off
set CMDER_SHELL=unknown
call :detect_comspec %ComSpec%
echo Cmder Shell is: %CMDER_SHELL%
goto :eof
:detect_comspec
if /i "%~nx1" == "cmd.exe" set CMDER_SHELL=cmd
if /i "%~nx1" == "tcc.exe" set CMDER_SHELL=tcc
if /i "%~nx1" == "tccle" set CMDER_SHELL=tccle
exit /b 0 As an added bonus, this method doesn't rely on calling an external Hope this helps! |
@DRSDavidSoft looks good to me. Will get it changed or as always PRs are welcomed! |
@daxgames Awesome! I made a PR in #2744 although this is untested code. Will appreciate it if you could test it first and then merge it. @berndgoetz hopefully this will fix the issue for you, as well. |
@DRSDavidSoft Amazing! I was just opening my laptop to do this. Testing now. |
Minimal comspec detection (related to #2744)
@DRSDavidSoft Made a small change to fix and merged after testing. @berndgoetz please test and let is know. |
@daxgames Thanks for merging! |
@berndgoetz note build is failing right now so you will need to copy the file from Github into your current install. |
Guys, you rock! I've put the file into my current setup and it works like a charm! Thanks a lot! I leave it up to you to keep this issue open until the new release is out or you close it already now. Greetings. |
@berndgoetz thank you running Cmder on company managed systems has long been slow if not impossible for some so any improvement helps. It is extremely difficult for us to fix these types of things because we do not have the system you have to replicate issues and test fixes. The fact you were able to narrow down to the line of code that was causing the issue was huge and makes our job easy. @DRSDavidSoft thank you for the fix. I am not sure I would have come up with what you provided and I certainly would not have come to it so quickly. Much appreciated! |
@daxgames Hey man, I appreciate all the efforts you do for the Cmder, and I'm glad to be of any kind of help regarding optimizing the code! 😄 Hopefully, if the issue is resolved now, we can close the issue. (I have some other PRs there also eagerly waiting to be merged! 😅 ) |
Purpose of the issue
Version Information
Cmder 1.3.19
Windows 10 with Avecto Whitelisting software
Description of the issue
At startup of Cmder, it calls the following command:
C:\WINDOWS\System32\find /i "\cmd.exe"
This command triggers our Avecto whitelisting security to block the call, or asks me for the Windows password to override and call it anyway. This is an Avecto policy setting.
Running the command without the backslash in front of the cmd.exe, i.e.:
C:\WINDOWS\System32\find /i "cmd.exe"
works without an issue.
Now my questions:
Thanks.
The text was updated successfully, but these errors were encountered: