# Windows can't find .exe - another .bat question



## bzbz (Feb 18, 2008)

I have a .bat that works:
start WINWORD

I have a .bat that doesn't work:
start foo.exe

I get an error message that says Windows can't find foo.exe. 
It is visible and all spelling etc is correct.

I can put in the full path and it works, but I am questioning why I can open Word without the full path, but not the foo executable.


----------



## Squashman (Apr 4, 2003)

Because Word is in your path and foo.exe is not.

Open up a cmd prompt and type path. Windows will search those directories for the executable if you don't specify a path. so you have a couple of options.

1) Use the path in your batch file.
2) Put the executable in one of the directories that is in your path variable.
3) add the directory that you have the executable in to your path variable.


----------



## bzbz (Feb 18, 2008)

Thanks Squashman.
If I were to chose 3
3) add the directory that you have the executable in to your path variable.
how do I do that? 
And how are those path variables chosen in the first place? I see paths that don't relate to Windows, so various installs must add their path variable upon install. Just curious.

I don't know what kind of effort the answer to my first question entails, so if ridiculous I apologize.


----------



## Squashman (Apr 4, 2003)

Very easy.
Right Click My Computer > Select Properties > Select Advanced Tab > Select the Environmental Variables Button.

Under System Variables, Select path and click the Edit button.
Add your path to the end. Each path is separated by a semi colon. Put a semi colon at the end and then type in the directory path to where your executable is. Just the directory path.


----------



## bzbz (Feb 18, 2008)

Thanks so much.

Another question. 
Does Windows establish a default set of paths? I am just wondering how the current paths that I have were determined. As I have never added to or subtracted with this approach. Didn't even know it existed for that matter.

I really appreciate your time.


----------



## Squashman (Apr 4, 2003)

Windows by default puts in the System directories. And as you stated above, some programs like to add their own directories to the path. I wouldn't suggest removing those if those programs are still installed.


----------



## bzbz (Feb 18, 2008)

You have been a major help!
I'm sure I'll be back.


----------

