bashrc substitute in Windows for making auto execution of CMD commands in each bootstrapping?

1

I want that each time I start the Windows CMD, a certain command will run.

In Nix systems like Ubuntu or Centos, I would just add the desired command to /etc/bash.bashrc or /home/USERNAME/.bashrc ...

Is there a bashrc substitute in Windows?

I would love to edit this file and add my desired command there, so that in each bootstrapping of CMD, it will run first and foremost!

JohnDoea

Posted 2016-12-16T16:04:02.860

Reputation: 1 029

There is an answer here. Alternatively, you can create a short-cut which launches cmd with a /k command. In either case you specify a batch file of your choice.

– AFH – 2016-12-16T16:32:30.597

Switch to Powershell (It will be the default soon, might as well switch now). In Powershell, you can setup a Profile.ps1 file. – Zoredache – 2016-12-16T18:12:56.323

Answers

2

From cmd /?:

If /D was NOT specified on the command line, then when CMD.EXE starts, it
looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if
either or both are present, they are executed first.

    HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun

        and/or

    HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

user364455

Posted 2016-12-16T16:04:02.860

Reputation: 2 679

-1

You could try Cmder.

/cmder/config/user-startup.cmd is the equivalent of .bashrc.

NitoriKawashiro

Posted 2016-12-16T16:04:02.860

Reputation: 1

Please read the question again carefully. Your answer does not answer the original question. – DavidPostill – 2016-12-17T10:31:55.487