Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

File deletion in root and subdirectories.

$
0
0

Greetings,

I have a question regarding Batch scripting. I am trying to create a system maintenancing script which removes .TMP and .BAK files from all of my drives both subdirectories and directories above. Let's say the Batch script would be placed into "Folder3" in the following internal drive address "C:\Folder1\Folder2\Folder3\Folder4\Folder5". And I want the batch script to remove files from folders 4 and 5 as subdirectories but also to remove files from C: Drive and folders 1, 2, and of course 3 itself but without removing folders. And I'd like to apply this method to all drives simultaneously without a human user personally moving the script via cut/copy and pasting from drive to drive. The other alternative which can come into consideration is to create a Batch File with any address location on the internal drive and when running this Batch file it'll create additional Batch Files on specified (multiple) drives at the very root of drives in the drive address of C:\ for instance, and initializes the required file deletion process. Some of the folders require my Administrator priviliges therefore I'd like to create a code within the script that ask for user permission and says "Yes" but without actually asking from me as the user to click "Ok" or "Yes" when running the script itself or to fully bypass the firewall. I have created the other part of the coding for deleting specified superfluous file types and in what way it's just the sub and above-directory part of it that gives me a pause to proceed. Any help is greatly welcome or pointers. If my request would seem cluttered please notify me of it and I'll try to simplify it down, although I hope I wasn't too confusing with the elaboration.

Thank you in advance, even for the consideration.

Kind Regards.


Viewing all articles
Browse latest Browse all 15028

Trending Articles