New
#1
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 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:
Then I rt-click on that (in the Start menu program list) and select 'Pin to Start':
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; 25 Jun 2020 at 05:39.
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.I did a similar same thing but I added mine to a custom Toolbar on the Taskbar.
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.
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
Well, you can put it in the Start menu or Start 'pane' as I did.
- - - Updated - - -
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.