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
    Toolsmith

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

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

    Hope that helps.