Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
Scheduling Powershell Scripts
Last Post 03 Aug 2011 05:41 AM by
Bobdee
. 1 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
duh-powershell
New Member
Posts:7
03 Aug 2011 05:35 AM
Folks
I have a script that cleans out files older than X days from a windows folder.
If I run it manually it runs great, but when I schedule it, it runs without errors but returns no errors and does not delete the older files.
Any ideas?
Regards
Bobdee
Basic Member
Posts:130
03 Aug 2011 05:41 AM
I have an archiving script and I use scheduled tasks to run it weekly. Here's the command I use to run it.
start program
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe
argument
-command "& 'E:\PS-Scripts\ArchiveMe\ArchiveMe v1.7.ps1'"
test it in you run command prior to entering it into your scheduled task... like this. Obviously changing the path to your script ;-)
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -command "& 'E:\PS-Scripts\ArchiveMe\ArchiveMe v1.7.ps1'"
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Active Directory
--Exchange Server
--Lync Server
--SharePoint
--SQL Server
--System Center
--Non-Microsoft Products
--Books, Tools, and Videos
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2