Note that there are some explanatory texts on larger screens.

plurals
  1. POEnvironmental variable not working (Win 7) for a batch file (cake.bat from CakePHP)
    text
    copied!<p>I'm getting started with CakePHP, and I'm trying to set my Windows 7's (64-bit) environmental variable PATH to recognize C:\xampp\htdocs\cakeblog\cake\console\cake.bat anywhere when using the command prompt.</p> <p>I have set the environmental PATH variable for php.exe, and it is working great. However, when I was setting it, it didn't work when I added the path to the system variable. I had to add it to the user variable for it to work for some reason. I have no clue why this is so.</p> <p>I tried doing the same for "C:\xampp\htdocs\cakeblog\cake\console," but it doesn't work for some reason neither in the system or user variable. I'm restarting the command prompt for the change broadcast to take effect, but it still doesn't work, while it works for php.exe. are .bat files different handled or something? I can't start the CakePHP baking process!</p> <p>Any idea how to get this path included so that I can access cake.bat? Creating another .bat file (like runcake.bat) to directly run C:\xampp\htdocs\cakeblog\cake\console\cake.bat is not an option, as cake.bat creates files in the folder relative to where it's run. So, if I go to C:\xampp\htdocs\cakeblog\cake\console\ and run cake.bat, it will try to create files as C:\xampp\htdocs\cakeblog\cake\console as its root directory when I really want the files to be created somewhere like C:\mysite.. TIA!</p> <p>My user path is below. cake.bat is located in the second directory.</p> <pre><code>C:\xampp\php; C:\xampp\htdocs\cakeblog\cake\console </code></pre> <p>UPDATE: I just gave up with this approach and just wrote a short batch file named setpaths.bat that includes "set path=C:\xampp\htdocs\cakeblog\cake\console;C:\xampp\php" in it. This seems to override my user path variable and works great. I'll just have to run setpaths.bat every time I need to bake something.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload