• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

delete all files from a client folder with windows 10

Scheduled Pinned Locked Moved
General
2
7
616
Loading More Posts
  • 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.
  • G
    Gilberto Ferraz
    last edited by Jul 7, 2021, 11:12 AM

    Hello, is it possible to program a task or a snapin to delete all files from a client folder with windows 10 operating system?

    G 1 Reply Last reply Jul 7, 2021, 1:32 PM Reply Quote 0
    • G
      george1421 Moderator @Gilberto Ferraz
      last edited by george1421 Jul 7, 2021, 7:32 AM Jul 7, 2021, 1:32 PM

      @gilberto-ferraz The quick answer is yes. The fog client (which executes the snapins) runs as SYSTEM on the target computer. It has SYSTEM level rights to remove as many files as you want, and even some you may not want.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      G 1 Reply Last reply Jul 7, 2021, 1:45 PM Reply Quote 0
      • G
        Gilberto Ferraz @george1421
        last edited by Jul 7, 2021, 1:45 PM

        Thanks for the quick response @george1421, but do you know any snapin or reference that has the function of deleting the contents of the transfers folder from the client’s machine ??

        G 1 Reply Last reply Jul 7, 2021, 2:05 PM Reply Quote 0
        • G
          george1421 Moderator @Gilberto Ferraz
          last edited by george1421 Jul 7, 2021, 8:05 AM Jul 7, 2021, 2:05 PM

          @gilberto-ferraz I’m not sure I understand about transfer folder.

          In general you can create a snapin that runs a batch file. In that batch file you can run the DOS commands to remove the directory.

          If you want to remove the directory AND its contents use this command.

          rmdir /s /q "D:\Transfer"
          

          If you want to remove just the contents of the Transfer folder then

          del /s /q "D:\Transfer\*"
          

          Since you didn’t say where the transfer folder was, I guessed in the commands above.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          G 1 Reply Last reply Jul 7, 2021, 2:29 PM Reply Quote 0
          • G
            Gilberto Ferraz @george1421
            last edited by Jul 7, 2021, 2:29 PM

            @george1421 Hello again, ok I got it, I must create a Bash file type

            echo deleting files
            del “C:\Folder*.*” /s /f/q
            echo Done!

            upload this bash to the Fog server in “Snapin Management” and schedule it to run on the client machine I want. and whenever you want 🙂

            are these the correct steps?

            G 1 Reply Last reply Jul 7, 2021, 2:46 PM Reply Quote 0
            • G
              george1421 Moderator @Gilberto Ferraz
              last edited by george1421 Jul 7, 2021, 8:47 AM Jul 7, 2021, 2:46 PM

              @gilberto-ferraz Just two points in your previous post we need to fix.

              Batch := MS Windows command script
              Bash := Linux shell script

              There is a difference.

              Also on your del command. you are missing a following backslash.

              del "C:\Folder\*.*" /s /f/q
              

              One hint too, the double quotes you used must have came from MS Word or similar because they are the double byte version (look closely your double quote marks look different than the ones I used). Use notepad to write your batch script.

              The reset is spot on in your post.

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

              G 1 Reply Last reply Jul 7, 2021, 3:14 PM Reply Quote 0
              • G
                Gilberto Ferraz @george1421
                last edited by Jul 7, 2021, 3:14 PM

                @george1421 Excellent explanation 🙂 Thanks for the help. I will close the post as resolved I believe it will work 🙂

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                1 / 1
                • First post
                  6/7
                  Last post

                220

                Online

                12.0k

                Users

                17.3k

                Topics

                155.2k

                Posts
                Copyright © 2012-2024 FOG Project