Skip to content
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

"\config\profile.d\Active"' is not recognized as an internal or external command, operable program or batch file. #1102

Closed
Albert-Gao opened this issue Sep 28, 2016 · 12 comments

Comments

@Albert-Gao
Copy link

Every time I open cmder, no matter directly double click the .exe file or via 'cmder here' form the context menu.

I use the windows 10 1607

It shows the following first:

Active code page: 65001
Found old git version in "C:\Users", but not using...
'"D:\OneDrive\Personal\Software\cmder\config\profile.d\Active"' is not recognized as an internal or external command, operable program or batch file.

  1. The first line is because I changed the code page to UTF8.
  2. The second problem may occur due to I have two git, one is windows version git, the other is installed from the Linux subsystem via sudo apt-get install git.
  3. The 3rd line is really annoying.

How to solve the 2rd and 3rd line issue?

@daxgames
Copy link
Member

daxgames commented Oct 4, 2016

'dir D:\OneDrive\Personal\Software\cmder\config\profile.d' output? I'm guessing you have a '*.cmd' file in that folder that begins with 'Active' and has spaces in it.

@Albert-Gao
Copy link
Author

@daxgames hi, it's empty :D

@daxgames
Copy link
Member

daxgames commented Oct 4, 2016

Edit %cmder_root%\vendor\init.bat and change if not defined verbose-output ( set verbose-output=0 ) to if not defined verbose-output ( set verbose-output=1 ).

Start a new cmder tab and paste the output here.

@Albert-Gao
Copy link
Author

Active code page: 65001
Found old git version in "C:\Users", but not using...
Enhancing PATH with unix commands from git in "C:\Program Files\Git\usr\bin"
Calling "D:\OneDrive\Personal\Software\cmder\config\profile.d\Active"...
'"D:\OneDrive\Personal\Software\cmder\config\profile.d\Active"' is not recognized as an internal or external command,
operable program or batch file.

Seems it wants to call something which is not exist..

@daxgames
Copy link
Member

daxgames commented Oct 4, 2016

The code that is calling that is below:

pushd "%CMDER_ROOT%\config\profile.d"
for /f "usebackq" %%x in ( `dir /b *.bat *.cmd 2^>nul` ) do (
  call :verbose-output Calling "%CMDER_ROOT%\config\profile.d\%%x"...
  call "%CMDER_ROOT%\config\profile.d\%%x"
)
popd

In cmder to the following:

cd %CMDER_ROOT%\config\profile.d
dir /b *.bat *.cmd 2^>nul

Paste output here.

@Albert-Gao
Copy link
Author

Albert-Gao commented Oct 4, 2016

λ cd %CMDER_ROOT%\config\profile.d

D:\OneDrive\Personal\Software\cmder\config\profile.d
λ ls

D:\OneDrive\Personal\Software\cmder\config\profile.d
λ dir /b *.bat *.cmd 2^>nul
File Not Found

D:\OneDrive\Personal\Software\cmder\config\profile.d
λ

:(

@daxgames
Copy link
Member

daxgames commented Oct 4, 2016

I have no idea. I don't know why it would find something there during startup and not after.

@daxgames
Copy link
Member

daxgames commented Oct 4, 2016

In %cmder_root%\vendor\init.bat add dir /b 2>nul on a new line after pushd "%CMDER_ROOT%\config\profile.d"

Start a new cmder tab and paste the output here.

Have you tried removing whatever you did to change the codepage and starting a new cmder window?

Does this happen when you start a powershell session or a bash session?

@Albert-Gao
Copy link
Author

Albert-Gao commented Oct 5, 2016

Thank you so much sir.
I remove what I did to the code page, and the extra line is gone...
Just weird, how can a register value affect this situation...

I just changed the register value:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun

Thanks for your time! Really helps!

@Albert-Gao
Copy link
Author

A better solution here for someone who wish to change the system-wide command line code page in order to use new font in the default windows command line, this is the solution:

When you change this position:
[HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun]
Change to this:
@Chcp 65001>nul

Cmder will be fine since no output like Active code page: 65001 will be shown

@daxgames
Copy link
Member

daxgames commented Oct 5, 2016

Glad you fixed it.

@daxgames
Copy link
Member

daxgames commented Oct 5, 2016

You could add that command to %cmder_root%\config\user-profile.cmd instead of the registry and it would be portable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants