diff --git a/composer.json b/composer.json
index 3f05454..e80ecbd 100644
--- a/composer.json
+++ b/composer.json
@@ -3,6 +3,7 @@
     "type": "drupal-module",
     "description": "Provides an image toolkit to integrate ImageMagick with the Image API.",
     "require": {
+        "drupal/core": "^8.3",
         "drupal/file_mdm": "^1",
         "drupal/file_mdm_exif": "^1"
     }
diff --git a/src/ImagemagickExecManager.php b/src/ImagemagickExecManager.php
index d24268e..89515ca 100644
--- a/src/ImagemagickExecManager.php
+++ b/src/ImagemagickExecManager.php
@@ -7,6 +7,7 @@ use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Session\AccountProxyInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Psr\Log\LoggerInterface;
+use Symfony\Component\Process\Process;
 
 /**
  * Manage execution of ImageMagick/GraphicsMagick commands.
@@ -267,46 +268,14 @@ class ImagemagickExecManager implements ImagemagickExecManagerInterface {
    * {@inheritdoc}
    */
   public function runOsShell($command, $arguments, $id, &$output = NULL, &$error = NULL) {
-    if ($this->isWindows) {
-      // Use Window's start command with the /B flag to make the process run in
-      // the background and avoid a shell command line window from showing up.
-      // @see http://us3.php.net/manual/en/function.exec.php#56599
-      // Use /D to run the command from PHP's current working directory so the
-      // file paths don't have to be absolute.
-      $command = 'start "' . $id . '" /D ' . $this->escapeShellArg($this->appRoot) . ' /B ' . $this->escapeShellArg($command);
-    }
     $command_line = $command . ' ' . $arguments;
 
-    // Executes the command on the OS via proc_open().
-    $descriptors = [
-      // This is stdin.
-      0 => ['pipe', 'r'],
-      // This is stdout.
-      1 => ['pipe', 'w'],
-      // This is stderr.
-      2 => ['pipe', 'w'],
-    ];
-
     Timer::start('imagemagick:runOsShell');
-    if ($h = proc_open($command_line, $descriptors, $pipes, $this->appRoot)) {
-      $output = '';
-      while (!feof($pipes[1])) {
-        $output .= fgets($pipes[1]);
-      }
-      $output = utf8_encode($output);
-      $error = '';
-      while (!feof($pipes[2])) {
-        $error .= fgets($pipes[2]);
-      }
-      $error = utf8_encode($error);
-      fclose($pipes[0]);
-      fclose($pipes[1]);
-      fclose($pipes[2]);
-      $return_code = proc_close($h);
-    }
-    else {
-      $return_code = FALSE;
-    }
+    $process = new Process($command_line, $this->appRoot);
+    $process->run();
+    $output = utf8_encode($process->getOutput());
+    $error = utf8_encode($process->getErrorOutput());
+    $return_code = $process->getExitCode();
     $execution_time = Timer::stop('imagemagick:runOsShell')['time'];
 
     // Process debugging information if required.
