{"action":"created","issue":{"url":"https://api.github.com/repos/opscode-cookbooks/windows/issues/111","labels_url":"https://api.github.com/repos/opscode-cookbooks/windows/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/opscode-cookbooks/windows/issues/111/comments","events_url":"https://api.github.com/repos/opscode-cookbooks/windows/issues/111/events","html_url":"https://github.com/opscode-cookbooks/windows/issues/111","id":41845335,"number":111,"title":"commands on path are not available after running windows_path","user":{"login":"dawilliams","id":581113,"avatar_url":"https://avatars.githubusercontent.com/u/581113?v=3","gravatar_id":"","url":"https://api.github.com/users/dawilliams","html_url":"https://github.com/dawilliams","followers_url":"https://api.github.com/users/dawilliams/followers","following_url":"https://api.github.com/users/dawilliams/following{/other_user}","gists_url":"https://api.github.com/users/dawilliams/gists{/gist_id}","starred_url":"https://api.github.com/users/dawilliams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dawilliams/subscriptions","organizations_url":"https://api.github.com/users/dawilliams/orgs","repos_url":"https://api.github.com/users/dawilliams/repos","events_url":"https://api.github.com/users/dawilliams/events{/privacy}","received_events_url":"https://api.github.com/users/dawilliams/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":50,"created_at":"2014-09-03T17:53:40Z","updated_at":"2015-08-13T19:30:45Z","closed_at":null,"body":"Chef:                           11.14.6\r\nWindows Cookbook:   1.34.2\r\nNode :                         Windows 2012\r\nI’ve encountered a scenario where after the windows_path resource is ran in a Chef run, other resources can't find items currently on the Windows path.  For example the batch resource fails with “STDERR: ‘cmd.exe’ is not recognized as an internal or external command.”  If you don’t have the windows_path resource in your recipe or if you run the recipe again, the batch resource can find the cmd command on the path."},"comment":{"url":"https://api.github.com/repos/opscode-cookbooks/windows/issues/comments/130812806","html_url":"https://github.com/opscode-cookbooks/windows/issues/111#issuecomment-130812806","issue_url":"https://api.github.com/repos/opscode-cookbooks/windows/issues/111","id":130812806,"user":{"login":"alexpop","id":107378,"avatar_url":"https://avatars.githubusercontent.com/u/107378?v=3","gravatar_id":"","url":"https://api.github.com/users/alexpop","html_url":"https://github.com/alexpop","followers_url":"https://api.github.com/users/alexpop/followers","following_url":"https://api.github.com/users/alexpop/following{/other_user}","gists_url":"https://api.github.com/users/alexpop/gists{/gist_id}","starred_url":"https://api.github.com/users/alexpop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexpop/subscriptions","organizations_url":"https://api.github.com/users/alexpop/orgs","repos_url":"https://api.github.com/users/alexpop/repos","events_url":"https://api.github.com/users/alexpop/events{/privacy}","received_events_url":"https://api.github.com/users/alexpop/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T19:30:45Z","updated_at":"2015-08-13T19:30:45Z","body":"I was able to reproduce the PATH issue on Windows 2012r2 when chef-client 12.4.1 is running as a service.\r\n\r\nRepro steps:\r\n\r\n1. Bootstrap a Windows 2012r2 instance using `knife bootstrap windows winrm ...`\r\n2. Use runlist `recipe[chef-client::default], recipe[mywin-cookbook::path_bug]`. Recipe path_bug can be found here: [path_bug.rb](https://github.com/alexpop/mywin-cookbook/blob/master/recipes/path_bug.rb)\r\n\r\nYou'll see that the chef-client run during bootstrap will succeed. Logging into the box and running chef-client will also succeed, even from a shell that doesn't have `C:\\Program Files (x86)\\Git\\Cmd` in the PATH.\r\n\r\nAny Chef run triggered by the Chef Client Service will fail with `STDERR: 'git' is not recognized as an internal or external command`. This can be see in the client.log and Reporting history.\r\n\r\nRestarting the chef-client service fixes the problem."}}