I need a Batch Script

It's a pain because I have to learn all the new syntaxes including the $ and .\ etc. Which I really don't want to/need to do.

Welcome to programming. I've had to learn several languages' syntaxes before for little things.

Basically the last missing piece of this script is:

Prompt user for drive letter
set output of prompt to variable "drive"
input variable drive to the script.

Sounds simple enough, but is not the simplest thing to do in batch coding. I have looked into wmic and will see if this will run on batch scripts executed on computers which I do not have administrative permissions on. This whole script is designed to be run on ANY computer regardless of permissions, so I need to make sure the whole thing is designed efficiently and that it works.

Did you try what I suggested at the end of my other post?

The reason you were having the permissions error with the Recycle Bin folder is because it's trying to set permissions on EVERY folder inside the root of the drive, which includes System folders (such as the Recycle Bin folder that gets created on every storage drive by default).

Because of this line:
icacls %LOCKFOLDER%\* /deny Everyone:F

Get around this by just putting everything you want to lock inside of a subdirectory, and then run icacls on the subdirectory instead of the root of the drive.
 
Back
Top Bottom