Saturday 21 October 2017

msysgit - How to run internal cmd command from the msys shell?


The Windows CMD utility has a number of internal commands, such as mklink. How can they be used from the msys shell ?


From CMD's documentation, the /c switch can be used to execute a command and exit; but this doesn't seem to work.



  • If I do cmd /c mklink the mklink command is not executed and the CMD shell is not exited.


Before pressing Enter:


enter image description here


After:


enter image description here


Process Monitor screenshot:


enter image description here



  • Trying to run the command as a background process: cmd /c mklink & apparently works - the mklink command is executed, but the CMD shell is not terminated. Every time Enter is pressed, CMD will become the active shell.



Answer





  1. Search your %PATH% for cmd.cmd or cmd.bat. They may interfere with your cmd




  2. Run Process Monitor and run your cmd /c mklink. Examine ProcMon log for really executed commands.




No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...