Search code examples
javawindows-7installationwindows-xpadmin

Need to get Start Menu Paths in Java


Using java, I would like some code that could get me the paths for: 1) Start Menu for Current User 2) Start Menu for All User

I need the answer for both WinXP and Win7. So hopefully there is a general answer that can get me both.


Solution

  • Okay, I figured out a solution, but maybe someone else has a more eligant one.

    I plan on doing something like "Runtime.getRuntime().exec(command);" and the command will be a "reg query" to query the following registry keys:

    Current User can referenced by: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Start Menu

    All users can be referenced by: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Start Menu

    These are the same for both Win7 and WinXP. If anyone else knows of a better solution, I'll be happy to look at it too.