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

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

Run pinned taskbar apps at windows startup?

问题

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

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

批处理文件没有成功:

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:

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

答案1

得分: 1

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

英文:
Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
{
    FileGetShortcut, %A_LoopFileLongPath%, ShortcutTarget
    SplitPath, ShortcutTarget, , , , name
    Process, Exist, %name%.exe
    If (!ErrorLevel)
    {
        Run, %ShortcutTarget%
    }
}
return

This ended up being the best solution.

答案2

得分: 0

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

Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
	Run %A_LoopFilePath%,, UseErrorLevel
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.
Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
{	
	FileGetShortcut, %A_LoopFilePath%, path
	SplitPath, path, name

	If (name = "")
		continue

 	; exclude unwanted windows
	If name contains mspicons.exe,OneDrive.exe
		continue

 	; skip already running processes
	If WinExist("ahk_exe" name)
		continue

	Run %A_LoopFilePath%,, UseErrorLevel
}

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

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

     Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
     	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:

Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
{	
	FileGetShortcut, %A_LoopFilePath%, path
	; MsgBox, %path%
	SplitPath, path, name
	; MsgBox, %name%

	If (name = "")
		continue

 	; exclude unwanted windows
	If name contains mspicons.exe,OneDrive.exe
		continue

 	; skip already running processes
	If WinExist("ahk_exe" name)
		continue

	Run %A_LoopFilePath%,, UseErrorLevel
}

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:

确定