This is my pet project. Run apps in order automatically at startup in Windows with registering vbs in taskscheduler's logon trigger.
using module ".\lib\RunAsync.psm1"
RunAsync "Notepad.exe"
RunAsync "Notepad.exe" -WinTitle "Untitled - Notepad"
RunAsync "Notepad.exe" -WinTitle "Untitled - Notepad" -HideWin
RunAsync "Taskmgr.exe" -WinTitle "Task Manager" -HideWin
Get-Process | ? {$_.ProcessName -eq "notepad"} | Format-Table MainWindowTitle
Get-Process | ? {$_.MainWindowTitle} | Format-Table MainWindowTitle
%%{
init: {
'sequence': {
%% 'showSequenceNumbers': true
}
}
}%%
sequenceDiagram
actor Me
Note over Me: Sleeping #128564;
Computer ->> Computer: Wake up by BIOS #128343;
Computer ->> CustomStartup: Run by TaskScheduler at startup
Note over CustomStartup: Run Scripts in order
alt when screen light is on
Computer --x Me: Disturb sleeping #128547;
end
CustomStartup ->> Computer: Turn off screen ASAP #10071;#10071;
alt when screen light is off
Computer -->> Me: Sleep well #128124;
end
CustomStartup ->> Computer: Start background apps
CustomStartup ->> Computer: Start the usual apps
Note over Me: Get up #128355;
Me ->> Computer: Good Morning #128512;
Computer ->> Me: Everything is prepared #128526;
Me ->> Computer: Good Boy #129299;