Hi, I want to basically take ownership in a batch file of all folders in the current directory. I want to use it to make sure i have access to copy all of the data on a customer's drive before backing it up (and later realising there's data missing, particularly the user folder). I'm creating a batch file that deletes junk files and backs up the data automatically but I'm having trouble.
I know the right-click context menu "Grant Admin Full Control" works perfectly but I want to do it to the current directory in a batch file so my other commands can run afterward, rather than taking full control and coming back ages later to do the next step, I want to make it one step. I have tried a few methods of the web but none appear to be doing the job. the best I can get is about 3 methods that seem to take ownership of the current folder once for every file in the directory which isn't helpful and I think I once got it to take ownership of the folders only but not files... any help?
I know the right-click context menu "Grant Admin Full Control" works perfectly but I want to do it to the current directory in a batch file so my other commands can run afterward, rather than taking full control and coming back ages later to do the next step, I want to make it one step. I have tried a few methods of the web but none appear to be doing the job. the best I can get is about 3 methods that seem to take ownership of the current folder once for every file in the directory which isn't helpful and I think I once got it to take ownership of the folders only but not files... any help?