You can use PowerScript to assign and change menu bars in Windows.
menu.menu item
You must always fully qualify the menu item with the name of the menu.
When referring to a menu item in a drop-down or cascading menu, specify each menu item on the path to the menu item you are referencing, using periods to separate the names.
m_menu.m_file.m_open.Enabled
Use the ChangeMenu function in a script to change the menu associated with a window at runtime.