在Windows启动时运行固定到任务栏的应用程序?

huangapple go评论189阅读模式
英文:

Run pinned taskbar apps at windows startup?

问题

如何在启动时运行所有固定到任务栏的应用程序?

似乎是一个理想的功能。我将应用程序固定到任务栏,因为我希望在Windows登录后立即点击它们。

批处理文件没有成功:

  1. for %1 in (%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk) do "%1"
英文:

How to run all apps that are pinned to taskbar at startup?

Seems like an ideal feature. I pin apps because I click them all once windows logs in.

No luck with batch file:

  1. for %1 in (%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.ink) do "%1"

答案1

得分: 1

这最终成为了最佳解决方案。

英文:
  1. Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
  2. {
  3. FileGetShortcut, %A_LoopFileLongPath%, ShortcutTarget
  4. SplitPath, ShortcutTarget, , , , name
  5. Process, Exist, %name%.exe
  6. If (!ErrorLevel)
  7. {
  8. Run, %ShortcutTarget%
  9. }
  10. }
  11. return

This ended up being the best solution.

答案2

得分: 0

这是您要翻译的代码部分:

  1. Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
  2. Run %A_LoopFilePath%,, UseErrorLevel
  1. Run "shell:startup" or type that into the explorer bar to navigate to startup folder and place a shortcut to the saved script file there.
  1. Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
  2. {
  3. FileGetShortcut, %A_LoopFilePath%, path
  4. SplitPath, path, name
  5. If (name = "")
  6. continue
  7. ; exclude unwanted windows
  8. If name contains mspicons.exe,OneDrive.exe
  9. continue
  10. ; skip already running processes
  11. If WinExist("ahk_exe" name)
  12. continue
  13. Run %A_LoopFilePath%,, UseErrorLevel
  14. }

请让我知道如果您需要更多帮助。

英文:
  • Create an autohotkey script and add this code to it:

    1. Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
    2. Run %A_LoopFilePath%,, UseErrorLevel
  • Run "shell:startup" or type that it into the explorer bar to navigate to startup folder and place a shortcut to the saved script file there.

EDIT:

To exclude unwanted windows or skip already running processes, try this:

  1. Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
  2. {
  3. FileGetShortcut, %A_LoopFilePath%, path
  4. ; MsgBox, %path%
  5. SplitPath, path, name
  6. ; MsgBox, %name%
  7. If (name = "")
  8. continue
  9. ; exclude unwanted windows
  10. If name contains mspicons.exe,OneDrive.exe
  11. continue
  12. ; skip already running processes
  13. If WinExist("ahk_exe" name)
  14. continue
  15. Run %A_LoopFilePath%,, UseErrorLevel
  16. }

huangapple
  • 本文由 发表于 2023年6月29日 23:07:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76582329.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定