New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to locate executable file: 'wmic' #7198
Comments
Can someone help me to resolve this problem? |
@Terryxxx |
@nigurr Thanks for your comments. I will try it. |
@Terryxxx are you unblocked now? |
@ShreyasRmsft Problem is not solved |
@ShreyasRmsft Yes, I have checked my path and verified wmic.exe in C:\WINDOWS\System32\Wbem\ . Please see the follow pic. |
@Terryxxx last time I saw this issue was when the build/release definition was overriding the value of Path environment variable. Can you cross check in variable tab to see if Path variables is not getting set |
Also one simple check you can do is add a powershell task with the following code: Write-Host $env:PATH This will tell us for sure. |
@ShreyasRmsft I have added a task about it, but it run failed. Following is failed log. 2018-05-22T02:43:28.6520608Z ##[debug]Evaluating condition for step: 'PowerShell Script'
2018-05-22T02:43:29.3990540Z ##[error]Process completed with exit code 0 and had 1 error(s) written to the error stream. |
@Terryxxx the failure with wmic was expected. But i don't see the output for Write-Host $env:PATH If you haven't added Write-Host $env:PATH add it to the script. Also i had specified the order intentionally as i had expected the wmic call to fail but wanted to know content of the PATH variable before wmic was called. Just run the script with just Write-Host $env:PATH that should tell us all we need to know |
@ShreyasRmsft I have added Write-Host $env:PATH. But it does't show any things when it run. Following is log: 2018-05-22T05:59:33.3102436Z ##[debug]Evaluating condition for step: 'PowerShell Script' |
Then it's clear that something in your definition is overriding your system path variable. But by the way why can't i see the Hello World output from your script? without the PATH variables value there is no way the task can get the location of wmic and it is bound to fail. Next step is to identify who is resetting or clearing the PATH variable. Can you send screenshots of your variables section of the build definition. You can also export your definition to a json file and attach it here or send it to devops_tools@microsoft.com |
@ShreyasRmsft Thank you very much! I have solved this problem. Cause by I set a "path" variable in definition variables, it reset computer environment path. I have deleted it, it can run successfully. |
This is old, but this thread just solved an issue I was dealing with for days! Thank you @ShreyasRmsft. For anyone else who may stumble across this issue... I was getting the same error as originally reported. On my server VM, I used powershell to I have never had to change this, so I found this reference to set the path variables: Step by step:
I queued up the build in TFS, and it ran perfectly. |
@michael-gaudet glad it helped :) Generally Wbem should be included in the PATH by default. Not sure if the image was a custom image or if the stock image was like that. |
Error: Unable to locate executable file: 'wmic'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
The text was updated successfully, but these errors were encountered: