Created
August 29, 2014 00:11
-
-
Save ebith/e62b4f189b881f4c606e to your computer and use it in GitHub Desktop.
5秒後に同階層以下のショートカットファイル(*.lnk)を起動するPowerShellスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sleep 5 | |
Set-Location (Split-Path ( & { $MyInvocation.ScriptName } ) -Parent) | |
Get-ChildItem -Recurse -include '*.lnk' -exclude 'startup.ps1.lnk' | ForEach-Object { | |
Invoke-Item $_.FullName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Windowsの初期設定ではps1ファイルがメモ帳に関連付けられているので、
実際使うには適当なショートカットを作った上で
リンク先
を"PowerShell -WindowStyle Hidden -ExecutionPolicy RemoteSigned C:\usr\app\Startup\startup.ps1"
などとする必要がある。
また、
実行時の大きさ
を"最小化"にしてもタスクバーに一瞬出てしまう。