1 Replies - 338 Views - Last Post: 28 January 2019 - 01:32 AM Rate Topic: -----

#1 seniorCSGuy   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 02-March 18

Powershell scripts that creates a task scheduler

Posted 27 January 2019 - 06:52 PM

Powershell script that execute only once on the next reboot.

Here is solution but it does not work. How can I fix

$action New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument 'C:\Users\myName\desktop\Create_file.ps1'

$trigger New-ScheduledTaskTrigger -AtStartup -Once 
Disable-ScheduledTask -TaskName startupScript


This post has been edited by seniorCSGuy: 27 January 2019 - 06:52 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Powershell scripts that creates a task scheduler

#2 andrewsw   User is online

  • never lube your breaks
  • member icon

Reputation: 6813
  • View blog
  • Posts: 28,189
  • Joined: 12-December 12

Re: Powershell scripts that creates a task scheduler

Posted 28 January 2019 - 01:32 AM

How does it not work? Have you discovered error messages? How have you configured it with Task Scheduler?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1