Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to associate .ps1 with powershell.exe instead of Notepad via GPO from a 2008r2 DC. I've seen one question mention CSE under Computer Configuration\Preferences\Control Panel Settings\Folder Options and setting it there. But I'm not sure exactly what to do and I can't find anything helpful anywhere.

share|improve this question
up vote 4 down vote accepted

You're close. Under Folder Options, Right Click in the main part of the area and go to New -> File Type

Action: Create
File extension: .ps1
Check Configure Class Settings
Under Action -> New
Action: Open
Application: *Path to Powershell*

Then OK/Save out.

Reference: TechNet: Configure a File Type Item

EDIT: Can't find the class, and I even used PowerShell to extract that dropdown list and search it...nothing.

There is a way to set it via Registry in Group Policy. The class is Microsoft.PowerShellScript.1 and full path to it is:


Change the (Default) value to:

"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-file" "%1"

This is found in the GPOE:

\Computer Configuration\Preferences\Windows Settings\Registry

SUMMARY: Create a new Registry Item:

  Action: Update
  Key Path: Microsoft.PowerShellScript.1\Shell\Open\Command
  Value name: Check Default
  Value type: REG_SZ
  Value data: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-file" "%1"

Then wait for GP flush on machines.

share|improve this answer
It's asking for an associated class. What should I put there? – Holocryptic Apr 8 '11 at 20:55
Touche. I can't find the class in the list. You can always just directly modify the registry using Group Policy. Interested? – Theo Apr 8 '11 at 22:05
Sure. Give me a rundown in an edit on your answer. – Holocryptic Apr 8 '11 at 22:12
Brilliant. I'll test this and mark appropriately. – Holocryptic Apr 8 '11 at 22:36
This worked. Thanks a bunch! – Holocryptic Apr 11 '11 at 14:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.