Adding shortcut icon to the start menu

  1. duceduc's Avatar
    Posts : 9
    windows 10
       #1

    Adding shortcut icon to the start menu


    I have created a powershell script for a custom shutdown. Is it possible to add the shortcut icon to the start menu. See image.
    Adding shortcut icon to the start menu-windows-sidebar.jpg
      My Computer

  2. Paul Black's Avatar
    Posts : 5,151
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #2

    Hello @duceduc,

    If I understand you correctly, I think it is probably going to need to ADD a REG key, probably somewhere like here . . .

    Code:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start

    I hope this helps!
      My Computer

  3. mngerhold's Avatar
    Posts : 235
    W10-1909
       #3

    My first thought was 'why does that need a registry key - surely one just adds a shortcut...?' So I tried that with a sc to a vbs script I use, and simply added it to the start menu folder at C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu, like so:
    Adding shortcut icon to the start menu-start1.png
    Then I rt-click on that (in the Start menu program list) and select 'Pin to Start':
    Adding shortcut icon to the start menu-start2.png
    Hey presto! (if 'Start' as opposed to the 'Start menu' was what you wanted). For some reason, it appears sc's to scripts (well, vbs at least) cannot be added to 'Start' in one step, as can sc's to executables. But then I tried with a sc to a Powershell script (.psi) and it simply opened in Notepad (or NP++), my default action. So I had to change the default action for a .ps1 to 'run Powershell', which meant finding the .exe down in Windows\System32\Windows Powershell, after which the sc worked from either the Start program list or 'Start'.

    There may be a way to create a sc to a .PS1 that runs without making that the default action for all .PS1 files, but I haven't managed that.
    <update>: create a sc to C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file your.ps1 and that should execute regardless of default .ps1 behaviour.

    I've no idea if this is any help to you, but I've learnt something! Martin

    PS duh! I realise you want to add it to the very LHS icons, in which case I don't know, and can't see how from what I've read so far.
    Last edited by mngerhold; 1 Week Ago at 05:39.
      My Computer

  4. Paul Black's Avatar
    Posts : 5,151
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #4

    Hello @duceduc,

    duceduc said:
    I have created a powershell script for a custom shutdown. Is it possible to add the shortcut icon to the start menu. See image.
    I did a similar same thing but I added mine to a custom Toolbar on the Taskbar.

    @mngerhold.

    Would your method not get deleted or corrupted if you were to run say Disk Cleanup for example?
      My Computer

  5. duceduc's Avatar
    Posts : 9
    windows 10
    Thread Starter
       #5

    I did a similar same thing but I added mine to a custom Toolbar on the Taskbar.
    In the toolbar on the taskbar, you mean here? If so, I would prefer not too since there is a chance I may accidentally click on it by mistake.
    Adding shortcut icon to the start menu-taskbar.jpg


    Currently, my shutdown powershell script sits on the desktop. I added this line in properties so I can just double click on it to activate it rather right click, run powershell. I would love to stow it away if all possible.
    Adding shortcut icon to the start menu-shutdown-icon.jpg
    Code:
    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "& 'D:\Scripts\Shutdown\Shut Down.ps1'"

    What code do I need to add at this registry??
    Code:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start
      My Computer

  6. mngerhold's Avatar
    Posts : 235
    W10-1909
       #6

    duceduc said:
    Currently, my shutdown powershell script sits on the desktop. I added this line in properties so I can just double click on it to activate it rather right click, run powershell. I would love to stow it away if all possible.
    Well, you can put it in the Start menu or Start 'pane' as I did.

    - - - Updated - - -

    Paul Black said:
    Would your method not get deleted or corrupted if you were to run say Disk Cleanup for example?
    I don't see why. Its just a sc, nothing that should get 'tidied away'. I also use a custom Toolbar, as that restores the 'fly-out' behaviour I last saw in XP, and loved. Quite why MS dropped it subsequently I don't know.
      My Computer


  7. Paul Black's Avatar
    Posts : 5,151
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #7

    Hello @duceduc,

    duceduc said:
    In the toolbar on the taskbar, you mean here? If so, I would prefer not too since there is a chance I may accidentally click on it by mistake.
    That is fair enough, it was just an option.
      My Computer

  8. Paul Black's Avatar
    Posts : 5,151
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #8

    Hello @mngerhold,

    mngerhold said:
    I also use a custom Toolbar, as that restores the 'fly-out' behaviour I last saw in XP, and loved. Quite why MS dropped it subsequently I don't know.
    Unfortunately MS decide what WE find useful and we don't get a say in it, but I know what you mean !!!
      My Computer


 

Related Threads
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 22:34.
Find Us




Windows 10 Forums