• 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
    637
    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.
    • Gilberto FerrazG
      Gilberto Ferraz
      last edited by

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

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @Gilberto Ferraz
        last edited by george1421

        @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!

        Gilberto FerrazG 1 Reply Last reply Reply Quote 0
        • Gilberto FerrazG
          Gilberto Ferraz @george1421
          last edited by

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

          george1421G 1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator @Gilberto Ferraz
            last edited by george1421

            @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!

            Gilberto FerrazG 1 Reply Last reply Reply Quote 0
            • Gilberto FerrazG
              Gilberto Ferraz @george1421
              last edited by

              @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?

              george1421G 1 Reply Last reply Reply Quote 0
              • george1421G
                george1421 Moderator @Gilberto Ferraz
                last edited by george1421

                @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!

                Gilberto FerrazG 1 Reply Last reply Reply Quote 0
                • Gilberto FerrazG
                  Gilberto Ferraz @george1421
                  last edited by

                  @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
                  • First post
                    Last post

                  132

                  Online

                  12.0k

                  Users

                  17.3k

                  Topics

                  155.2k

                  Posts
                  Copyright © 2012-2024 FOG Project