I'm trying to create a Windows shortcut that will be put in my startup folder. The shortcut starts a program (Discord), but with a 1-minute delay. I'm doing this because my (ancient) core i3-2100 PC that I forced to run Windows 11 Pro gets laggy when there are a bunch of programs that open during startup. My custom shortcut will minimalize the lag. The shortcut opens Windows Powershell and runs a command, but I'm having trouble typing the full path (that has some parameters) in the Target box from the shortcut's properties due to the character limit.
This what I'm trying to type into the Target box:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -WindowStyle Hidden -Command "Start-Sleep -Seconds 60 ; Start-Process 'C:\Users\User\AppData\Local\Discord\Update.exe' -ArgumentList '--processStart Discord.exe', '--process-start-args --start-minimized'"
I've tried to bypass the character limit by:
- Enabling Win32 long paths via Local Group Policy Editor
- Setting LongPathsEnabled to 1 via Registry Editor
Unfortunately, all of those methods didn't work.
Is there something I'm missing or should I consider creating a VBS or batch file instead?
I made a string that doesn't bypass the maximum character limit by using cmd
within a PowerShell command line (which is shorter because it doesn't need an -ArgumentList
parameter).
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -WindowStyle Hidden -Command "Start-Sleep -Seconds 60 ; cmd /c 'start C:\Users\User\AppData\Local\Discord\Update.exe --processStart Discord.exe --process-start-args --start-minimized'"
Unfortunately, it seems like there is no way to bypass the maximum character limit in the Target box. So, the only solution is finding a way to shorten the string.