Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Schedule a PowerShell

Posted on 2014-01-10
3
Medium Priority
?
333 Views
Last Modified: 2014-01-10
Want to schedule a powershell on WIndow 2008 but it doesn't work. Any idea ??


Program/Script : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add arguments (optional) : -noexit C:\Scripts\ChkDisk\ChkDisk.ps1
Start in (optional) : c:\scripts\ChkDisk

The powershell need a file computer.csv stored under c:\scripts\ChkDisk.

Tks
PowerShell.png
0
Comment
Question by:AXISHK
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
David Paris Vicente earned 2000 total points
ID: 39772876
You need to put powershell file before the the path location of the file.

Take a look here and see if help Task Scheduling Tutorial

Regards
0
 

Author Comment

by:AXISHK
ID: 39772901
Get-Content : Cannot find path 'C:\computer.csv' because it does not exist.

In fact, the power script and the file is store under c:\scripts\chkdisk\chkdisk.ps1.

How to ensure it look for the file where the script is stored ?

Tks
0
 

Author Closing Comment

by:AXISHK
ID: 39772904
It works fine.
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦
Screencast - Getting to Know the Pipeline

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question