Netbeabs editor Shell Extension

"marceloaleks" <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
> Thanks. That is good stuff. Thanks for sharing. I certainly hope Google has now registered your contribution so people will find it. Smile 
> What happens if NetBeans.exe is already open?   I hope it re-uses the existing process in that case? 

Yes it resuses the NB ! Take a try !



> Anyway, to broaden the issue a bit: 
> 
> Ever wondered why NetBeans IDE doesn't show up on the Windows Explorer's  "Open With" menu when you right-click a file?  I'm not (necessarily) talking about file associations here. I'm talking about the list of applications that comes up when you right-click a file for which there are no file associations, say  foo.bar33.   On my Windows 10 computer this only produces a *subset* of the applications installed on the computer, most of them from stock Windows, but also Notepad++. So how did Notepad++ get on the list, but not NetBeans IDE ? 


Yes, Netbeans do not register itself. It could be done easily in the install 

The piece of code to verify if the hook was already installed and to do if it not is:


Code:

set NBSHELL=NULL
for /f "tokens=1" %%a IN ('reg query "HKEY_CLASSES_ROOT\*\shell\Netbeans" ') do set NBSHELL=%%a

REM "SHELL EXTENSION"
if "%NBSHELL%"=="NULL" (
 ECHO Inserting Shell EXtension

 reg add "HKEY_CLASSES_ROOT\*\shell\Netbeans" /VE  /T REG_SZ /D "Open with Netbeans" /F
 reg add "HKEY_CLASSES_ROOT\*\shell\Netbeans" /V "Icon"  /T REG_SZ /D "%NBPATH%" /F
 reg add "HKEY_CLASSES_ROOT\*\shell\Netbeans\command" /VE  /T REG_SZ /D "%@NBPATH% \"%%1\"" /F
 REM cmd to remove shell ext => reg delete "HKEY_CLASSES_ROOT\*\shell\Netbeans"
)




Side effect: if you call "nb ." and the current directory has a netbeans project, this project will open, but if it´s not, a new tree with the contents will appear in the project area. Like as sublime !  :D  :D  :D  :D
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.