Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. var envar = Environment.GetEnvironmentVariable("PATH"); // Just the Path, no Exe
  2. int found = 0;
  3.  
  4.  
  5. // Check All Environment Variables Paths for ffmpeg.exe
  6. //
  7. foreach (var envarPath in envar.Split(';'))
  8. {
  9. // Path + Exe
  10. var exePath = System.IO.Path.Combine(envarPath, "ffmpeg.exe");
  11.  
  12. // Check
  13. if (File.Exists(exePath))
  14. {
  15. found = 1;
  16. }
  17. }
  18.  
  19.  
  20. // Display Message if FFmpeg exists
  21. //
  22. if (found == 1)
  23. {
  24. MessageBox.Show("FFmpeg exists.");
  25. }
  26. else if (found == 0)
  27. {
  28. MessageBox.Show("Cannot locate FFmpeg.");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement