Is there a .bashrc like file that Windows cmd shell reads on start-up?
I'd like to set a shorter prompt, the default prompt shows the full path to the current directory and it gets messy when I descend down several levels of sub-directories. Currently, I'm manually calling the PROMPT
command whenever the displayed path gets too long. It'll be nice to set it automatically.
For the cmd shell you need to create a . cmd file with whatever name you want (I called mine bashrc. cmd ) and place it somewhere in your filesystem where it isn't going to move around. I like to keep things organized in my Documents folder so mine is in %UserProfile%\Douments\Apps\cmd\bashrc.
bashrc . For my Windows machine, that's /c/Users/Leonardo/. bashrc .
As pointed out by Dai in the comment section, Powershell Profiles sound like the closest equivalent to the . bashrc file. A PowerShell profile is a script that runs when PowerShell starts. You can use the profile as a logon script to customize the environment.
As an alternative to SETX, you can create a batch file that will effectively act as .bashrc. Then create a registry key called AutoRun under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor and set the path to that file as a value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With