Forum Discussion

wallby's avatar
wallby
Copper Contributor
Aug 24, 2022
Solved

How to prompt for program to open file with using powershell

Hello,   I know that..     Start-Process -FilePath <path to file>     .. opens the file at path to file, however is it possible to, instead of opening with the default program, open the pro...
  • wallby's avatar
    Aug 26, 2022

    Answer was given here.. https://docs.microsoft.com/en-us/answers/questions/981421/how-to-prompt-for-program-to-open-file-with-using.html

     

    The answer..

     

    Use openwith.

     

    $ps = new-object System.Diagnostics.Process
    $ps.StartInfo.Filename = "openwith.exe"
    $ps.StartInfo.Arguments = "C:\temp\xxxxxxxx.txt"
    $ps.start()

     

     

     

Resources