Python locate "all programs" folder in the start menu

I'm trying to create a folder with shortcuts in it inside the windows folder "Programs" in the start menu. I've already found a way of creating shorkuts but I can't find a way to locate the "programs" folder in the start menu. For example to find the desktop folder I use:

os.environ["userprofile"]+"\\Desktop\\" 

but I want it with "programs" folder with the programs folder.

Note: I'm not searching for the "Program Files" Folder!!! I'm searching for the folder in the start menu "Programs", that for example in my computer is in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs"

Upvotes: 2

Views: 2268

Answers (2)

I found a solution, in the registry, there is a key named "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" that has the desktop, programs, start menu etc. I will be able to acces it with the _winreg module.

Upvotes: 2

KeJi
KeJi

Reputation: 288

This does it for me:

os.path.join(os.environ["userprofile"], "Start Menu", "Programs")

There's probably a more proper way to do it with the Windows API, but I don't know it.

Edit:

Here are a couple related materials for the Windows API that might help. I don't know the Windows API well enough to make a script for you, though.

Upvotes: 2

Related Questions