header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Scheduling Powershell Scripts
Last Post 03 Aug 2011 05:41 AM by Bobdee. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
duh-powershellUser is Offline
New Member
New Member
Posts:7
Avatar

--
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
    BobdeeUser is Offline
    Basic Member
    Basic Member
    Posts:130
    Avatar

    --
    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.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer