1. kotetsu75

    Posted

    kotetsu75
Changes in title
+Powershellでタスクスケジューラ登録
Changes in tags
Changes in body
Source | HTML | Preview
@@ -0,0 +1,11 @@
+#Powershellでタスクスケジュールを登録するためのメモ
+
+```powershell
+$User = New-ScheduledTaskPrincipal -UserId kotetsu75 -LogonType Password
+$Act = New-ScheduledTaskAction -Execute taskmgr.exe
+$Time = New-ScheduledTaskTrigger -Once -At 3am
+$Task = New-ScheduledTask -Trigger $Time -Principal $User -Action $Act
+Register-ScheduledTask -InputObject $Task -TaskName "test2" -TaskPath \ -User kotetsu75
+```
+
+Linuxだとcronで超簡単にできるのに。。。