![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | ps1 file type association I need to set powershell.exe as a default program for .ps1 file types for every user in one server (server 2008). Can i do it via some registry key? If i do it via Control panel - Default programs, it only applies to me but not for other users. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: ps1 file type association Bad idea. Not only are you compromising the security of your server, but if anyone other than you uses the server, double clicking a .ps1 file will act totally different than the way it is expected. Might I suggest instead coming up with your own extension for a "runnable" PowerShell script and only rename the scripts that you absolutely must run by double clicking. Better yet, just make shortcuts that launch PowerShell.exe with appropriate command line parameters... But if you must, you will want to relocate the following registry keys: HKCR\.ps1 -> HKLM\Software\Classes\.ps1 HKCR\Microsoft.PowerShellScript.1 -> HKLM\Software\Classes\Microsoft.PowerShellScript.1 Probably easiest to do this in regedit, exporting those keys to text files, editing them, and re-importing them. I don't really work with the registry provider in PowerShell much so I don't know how to do that via script off the top of my head. Josh "Eero J" <EeroJ@xxxxxx> wrote in message news:691CED60-A226-44B6-A133-7666D732A0B9@xxxxxx Quote: > I need to set powershell.exe as a default program for .ps1 file types for > every user in one server (server 2008). Can i do it via some registry key? > If > i do it via Control panel - Default programs, it only applies to me but > not > for other users. |
My System Specs![]() |
| | #3 (permalink) |
| | RE: ps1 file type association You are compromising your security by doing this. PowerShell deliberately does not associate powershell.exe with the .ps1 extension to prevent some of the problems seen with the automatic execution of VBScripts. call the scripts from batch files rather than doing this -- Richard Siddaway All scripts are supplied "as is" and with no warranty PowerShell MVP Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Eero J" wrote: Quote: > I need to set powershell.exe as a default program for .ps1 file types for > every user in one server (server 2008). Can i do it via some registry key? If > i do it via Control panel - Default programs, it only applies to me but not > for other users. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: ps1 file type association "RichS [MVP]" <RichSMVP@xxxxxx> wrote in message news:22E73585-B8FF-47AC-8BF6-132077629D58@xxxxxx Quote: > You are compromising your security by doing this. PowerShell deliberately > does not associate powershell.exe with the .ps1 extension to prevent some > of > the problems seen with the automatic execution of VBScripts. > > call the scripts from batch files rather than doing this PowerShell.exe the default action for a .ps1 file? If you double-click the batch file, it will execute the PowerShell script, what's the difference? |
My System Specs![]() |
| | #5 (permalink) |
| | Re: ps1 file type association The difference is that you are executing a single know script rather than making all scripts executable -- Richard Siddaway All scripts are supplied "as is" and with no warranty PowerShell MVP Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "John Vottero" wrote: Quote: > "RichS [MVP]" <RichSMVP@xxxxxx> wrote in message > news:22E73585-B8FF-47AC-8BF6-132077629D58@xxxxxx Quote: > > You are compromising your security by doing this. PowerShell deliberately > > does not associate powershell.exe with the .ps1 extension to prevent some > > of > > the problems seen with the automatic execution of VBScripts. > > > > call the scripts from batch files rather than doing this > How is calling a PowerShell script from a batch file more secure than making > PowerShell.exe the default action for a .ps1 file? If you double-click the > batch file, it will execute the PowerShell script, what's the difference? > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: ps1 file type association Because .bat files are expected and protected by many security measures such as attachment blocking, IE zone blocking, virus scanners, etc. Not to mention, like I said... what if someone other than you logs onto the machine, sees "Format-HardDrive.ps1" and says "oh that’s weird, let me double click that to see what it is?". "John Vottero" <JVottero@xxxxxx> wrote in message news:BF5259E9-B0B9-4C67-A01F-97EAF98FF17D@xxxxxx Quote: > "RichS [MVP]" <RichSMVP@xxxxxx> wrote in message > news:22E73585-B8FF-47AC-8BF6-132077629D58@xxxxxx Quote: >> You are compromising your security by doing this. PowerShell >> deliberately >> does not associate powershell.exe with the .ps1 extension to prevent some >> of >> the problems seen with the automatic execution of VBScripts. >> >> call the scripts from batch files rather than doing this > How is calling a PowerShell script from a batch file more secure than > making PowerShell.exe the default action for a .ps1 file? If you > double-click the batch file, it will execute the PowerShell script, what's > the difference? > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| ISO File Type Association? | General Discussion | |||
| windows mail and file type association... :-( | Browsers & Mail | |||
| Change File Type Association | Vista General | |||
| File type association | Vista account administration | |||
| Changing the edit association for a file type | Vista General | |||