Enhancement to launching PowerShell scripts from Far Manager

The method of launching PowerShell scripts from Far Manager I have described previously has 2 important drawbacks:

  1. You can’t pass arguments to the script, and
  2. You can’t launch script in a separate window

Here’s how to fix this:

  1. Start regedit, open HKCR\Microsoft.PowerShellScript.1\shell\Open\command key
  2. Set it to
    "C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe" "-file" "%1" %*

Now you can press Shift+Enter to start PowerShell script in a new window.

As a bonus, you can now double-click .ps1 files in Windows Explorer to launch them. Why is this not a default behaviour? Most likely Microsoft decided to be extra cautious here.

Make sure you have Powershell version 2.0 or higher for this to work. How to check Powershell version.

Tags: ,

3 Responses to “Enhancement to launching PowerShell scripts from Far Manager”

  1. Alexander Says:

    Hi.
    Thanks a lot for very useful tips!
    But why comments are off for most of your posts?
    For example, at http://chuchuva.com/pavel/2008/03/how-i-configure-far-manager/
    I have a comment to the paragraph 9 but can’t leave it there!

  2. Pavel Chuchuva Says:

    That’s because I was afraid of spam and set my blog to disable comments after 1 month, sorry. I have re-enabled comments for that post.

  3. Roman Kuzmin Says:

    Hi Pavel,

    It looks like you are a fun of Far Manager and you also use PowerShell. You may want to take a look at the plugin FarNet and its module PowerShellFar. They allow to run PS scripts in the same session hosted inside and provide Far Manager automation and a lot of tools, related to Far and even not.

Leave a Reply