If you wish to elevate and always run a Batch file as an administrator in Windows 11/10, follow the procedure laid down in this post. You can run a Batch file as Administrator without a prompt.
(2) A file of operating system commands that are carried out one after the other. The operating system interprets the commands and turns them into machine language executed by the CPU. Batch files ...
You need to edit the list to match the drives that you want to defragment using the batch file. If you want to defrag just one drive, then specify only the drive. Alternatively, instead of ...