Deleting old files on a remote computer with psexec does not work

Home Forums Scripting General Scripting Deleting old files on a remote computer with psexec does not work

Viewing 1 post (of 1 total)
  • Author
    Posts

  • BumbleBee
    Member
    #166938

    Hi,

    I’m running this script, but it does not work.
    I tried to change @path to D:Logs_Archive but it still does not work.

    What am I missing?

    D:scriptsLogRotationMM>psexec \192.168.1.2 forfiles -p “D:Logs_Archive” -s -m *.rar /D -7 /C “cmd /c del @path”

    PsExec v2.2 – Execute processes remotely
    Copyright (C) 2001-2016 Mark Russinovich
    Sysinternals – http://www.sysinternals.com

    ERROR: Invalid argument/option – ‘@path’.
    Type “FORFILES /?” for usage.
    forfiles exited on 192.168.1.2 with error code 1.

    Your help is appreciated.

    Thanks

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

The World’s Most Comprehensive Teams to Teams Migration Checklist

Whether you have just started thinking about migration or have already begun to move, our Microsoft Teams Migration Checklist can help guide you through the different phases for a Teams migration to another tenant.

This detailed six-step guide will walk you through key decision points while also providing more prescriptive best practice recommendations where appropriate.

Discover key insights for the following phases of a Teams migration: 

  • Discovery
  • Pilot
  • Planning
  • Communication
  • Execution
  • Validation

Sponsored by: