4 ms·
Has the cmd on windows an equivalent to .bashrc? If yes - TIL
by JCWasmx86 5y ago
Has the cmd on windows an equivalent to .bashrc? If yes - TIL
- mattowen_uk 5y agoYes it does - it's specified via a registry key. I tried to find a reliable page to link to but the best I could find was this: https://ss64.com/nt/syntax-autoexec.html https://ss64.com/nt/syntax-autoexec.html Many, many, moons ago Windows NT had support for an 'autoexec.nt' batch file which did the same, so it's not a new feature just horribly undocumented.
- banana_giraffe 5y agoIt is actually documented in cmd /? .. kinda. cmd's help shows that autorun is disabled with /d, and mentions which keys it looks for. I use it to have a different prompt for administrator windows. To anyone using it: Be careful. Any side effects in your autorun script can have entertaining effects on batch files when you least expect it.
- jaclaz 5y agoTo be more precise, besides the warning on SS64 site, check also this: https://renenyffenegger.ch/notes/Windows/registry/tree/HKEY_CURRENT_USER/Software/Microsoft/Command-Processor/index https://renenyffenegger.ch/notes/Windows/registry/tree/HKEY_... TLDR is that for /f loops do spawn a child cmd.exe process and you won't like the result (recursiveness).
- banana_giraffe 5y agoThat's one I hadn't seen before, and would assuredly cause fun. The common one I've seen surprisingly often is the autorun script doing "cd" and causing for /f loops to break in some way.
- recursive 5y agoPowershell does. Microsoft.PowerShell_profile.ps1
- deleted 5y ago[deleted]