Tech Off Post

Single Post Permalink

View Thread: PowerShell: Running an executable with a long filename and using a variable as a command line parame
  • User profile image

    It appears to me that your quotes are a bit mismatched, but other than that, this should work for you:

    $files = get-childitem -filter *.img
    foreach ($file in $files)
       &'C:\Program Files\DAEMON Tools\daemon.exe' -mount 0,$file.FullName

    Hope that helps.