1

I am probably missing some lingo to find the answer to a question which I believe has probably been posted already, hence my apologies beforehand.

I wrote a cmd script (myCmdFileName.cmd) that changes some IP configurations using netsh. To run it from cmd, I have to be in the same folder of the script and write in the console myCmdFileName.cmd.

As you know, netsh is a commandline application itself, as I would use it like:

netsh [-flags] [-configs]

What I would like to do is to have my cmd file be called just like as if it was an application like netsh, not worrying about whether I am in the file folder, so like this:

myCmdFileName [-flags] [-arguments]

How would I go about doing that in Windows cmd?

Thanks a lot in advance!

1 Answers1

2

In order to run myCmdFileName from anywhere, either it's parent folder needs to be added to %PATH%, or you can move it / create a symbolic link to it in a folder that already is in %PATH%.

m0sa
  • 10,712
  • 4
  • 44
  • 91