How to schedule a task to execute a PS1 script periodically

Source: Internet
Author: User

PS1 scripts are all executed and can be executed directly through Windows PowerShell, but what if we want to execute a PS1 script on a regular basis? We can implement this requirement by: System planning task, the implementation method is shown below

    1. Open: Computer Management, right-click: Task Scheduler, new Basic task,

650) this.width=650; "width=" 639 "height=" 271 "title=" image "style=" border:0px;width:538px;height:172px;padding-top : 0px;padding-right:0px;padding-left:0px;background-image:none; "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/ 82/b9/wkiom1dfcv-xrqubaagtdvchydc041.png "border=" 0 "/>

2. Enter the task Name

650) this.width=650; "height=" 373 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/82/B9/ Wkiom1dfcwcbmedyaacjfjo9ugo121.png "border=" 0 "/>

3. Select the period of task execution

650) this.width=650; "Width=" 492 "height=" 387 "title=" clip_image003 "style=" BORDER:0PX;WIDTH:538PX;HEIGHT:266PX; Padding-top:0px;padding-right:0px;padding-left:0px;background-image:none; "alt=" clip_image003 "src=" http:// S3.51cto.com/wyfs02/m00/82/b9/wkiom1dfcwhawegfaacfjxtvc3o946.png "border=" 0 "/>

4. Enter the start time of the command execution

650) this.width=650; "height=" 390 "title=" clip_image004 "style=" border:0px;padding-top:0px;padding-right:0px; Padding-left:0px;background-image:none, "alt=" clip_image004 "src=" http://s3.51cto.com/wyfs02/M00/82/B8/ Wkiol1dfdbbicirkaabodi1fjb0966.png "border=" 0 "/>

5. Select Start a program

650) this.width=650; "height=" 391 "title=" clip_image005 "style=" border:0px;padding-top:0px;padding-right:0px; Padding-left:0px;background-image:none, "alt=" clip_image005 "src=" http://s3.51cto.com/wyfs02/M01/82/B8/ Wkiol1dfdbqiauw2aabtbdii1ho920.png "border=" 0 "/>

6. Browse the directory where PowerShell is located and enter the following parameters

-command "." C:\test.ps1 ' "

650) this.width=650; "height=" 407 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/82/B9/ Wkiom1dfcwryd7tkaacqwfhigj0401.png "border=" 0 "/>

7. Click Finish and open the task's Properties window

650) this.width=650; "height=" 406 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/82/B9/ Wkiom1dfcwvrtt34aadufqiegg0061.png "border=" 0 "/>

8. Tick: Run as administrator, or the task will report permissions error when executing

650) this.width=650; "height=" 436 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/82/B9/ Wkiom1dfcw2gzk-qaae9trw1yl4380.png "border=" 0 "/>

This article is from "Jianbin Liu's Blog" blog, please be sure to keep this source http://liujb.blog.51cto.com/269257/1789041

How to schedule a task to execute a PS1 script periodically

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.