Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running AutoHotkey 1.0.48.05 on Windows 7.

I'd like CTRL-ALT-P to open PowerShell.

This is what I have so far:

^!p::
    Run %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
Return

This is the error I get:

File C:\Users[username]\Documents\WindowsPowerShell\profile.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.

I've already set the execution policy to RemoteSigned by opening PowerShell ISE as Administrator and running Set-ExecutionPolicy RemoteSigned. (See http://technet.microsoft.com/en-us/library/ee176949.aspx)

How can I get around this problem?

share|improve this question
    
aaht happens if you manually run %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe? –  techie007 Sep 25 '12 at 3:56
    
PowerShell opens (but for some reason it's black instead of blue when I open it this way) –  Ryan Sep 25 '12 at 3:58
    
Thats what it looks like when you run it in cmd.exe –  soandos Sep 25 '12 at 5:06
    
Have you tried setting the execution policy to something less restrictive. RemoteSigned perhaps? In a powershell session: Set-ExecutionPolicy RemoteSigned –  EBGreen Sep 25 '12 at 18:22
1  
I will point out however that if you are in a 64 bit version of windows, you would need to set the execution policy for both 64 bit powershell and 32 bit just to be sure that wasn't it. –  EBGreen Sep 25 '12 at 19:16
show 4 more comments

2 Answers

up vote 2 down vote accepted

If you are in a 64 bit version of windows, you would need to set the execution policy for both 64 bit powershell and 32 bit.

share|improve this answer
    
Good call, didn't know this. –  BigHomie Jan 11 '13 at 20:32
add comment

I recently ran into the same issue. Instead of changing my execution policy for all scripts, I went with this:

#p::
^!p::
EnvGet, SystemRoot, SystemRoot
Run %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy unrestricted,
return
share|improve this answer
add comment

Your Answer

 
discard

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.