powershell - On Windows, are there restrictions on extensions that can be used in PATHEXT? -


i trying set file associations on windows machine files extension .script run without needing extension specified (much .bat, .ps1, .py files).

i have set things using following batch file:

reg add hkcu\environment /v pathext /t reg_expand_sz /d "%%pathext%%;.script" reg add hkcu\software\classes\.script /ve /d "script.file" reg add hkcu\software\classes\script.file /ve /d "script file hashbang line" reg add hkcu\software\classes\script.file\shell\open\command /ve /d "\"c:\windows\py.exe\" \"%%1\" %%*" 

this almost works, when run .script file, runs in new window, rather in current console session.

if change extension have chosen shorter, .sf, works fine.

is there limitation on file extensions can used in console, have less 3 characters, or something?

(in case it's relevant, on windows 7, 64-bit).

update: seems happen in powershell. both cmd , tcc (tcc/le) work expected (the script run in console session).

looks known bug in powershell: https://connect.microsoft.com/powershell/feedback/details/238550/power-shell-trimming-extension-to-3-characters-when-resolving-file-associations

from bug report, looks ms don't intend fix :-(


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -