Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Deleting files script

Deleting files script

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 47.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    D
    dersonik
    wrote on last edited by
    #1

    Is that possible to run the script from netxms to delete downloads folder (files inside downloads) in windows server 2012 ?

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi,

      yes, you can define action in agent (using Action or ActionShellExec entries in nxagentd.conf) and then define object tool to run it manually or server side action of type "execute action on remote agent" to run it automatically from event processing policy.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • D
        D
        dersonik
        wrote on last edited by
        #3

        Ok i'm using powershell with command:

        ActionShellExec=cleandownloads:powershell -command "& ls ~\Downloads\ | remove-item -force -recurse"
        and this command not working from netxms but working in powershell

        i have too
        ActionShellExec=cleantemp:powershell -command "& ls C:\Windows\TEMP\ | remove-item -force -recurse"
        and this commands works fine form powershell and from agent

        any ideas?

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4

          Hi,

          I'm suppose ~ in ~\Downloads\ refers to home directory of the user - but if you run agent as a service it by default runs under local system account, so ~ points to completely different place.

          Best regards,
          Victor

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups