Hi, I am wanting to make a batch file that copies another batch file to all folders inside a directory and then runs them (copying to unknown user folders on my customer's hard drives to delete temp files and copy e-mail files and address books etc., so the username variables are not available), i have this line which copies the batch file into every directory:
for /R %%i in (.) do copy "%CD%\copyme.bat" "%%i"
but i am having trouble calling each of the batch files, when i do i get a ".\" in the middle of each, for example if i use for /R %%i in (.) do call "%%i\copyme.bat it tries to run c:\test\1\.\copyme.bat instead of c:\test\1\copyme.bat.
how do i remove the .\ from the variable or is there another way to do this? unfortunately as this will run on many different hard drives taken from many different computers before backing up and reinstalling windows, each time the user folders will be different plus sometimes there will be multiple users. There is no point in backup up temp Internet files, temp folder and other junk, so i want to delete it before copying, since i do this several times in a day it will save much time. i just made a Windows folder cleanup and used it on a customer's 85GB Backup and without deleting anything useful like system32 and inf, etc i managed to get the backup down to 30GB and saved copying all those files and folders, now i am working on the batch file for cleaning up User folders but since it's a variable i need to solve the problem in a different way.
thanks
for /R %%i in (.) do copy "%CD%\copyme.bat" "%%i"
but i am having trouble calling each of the batch files, when i do i get a ".\" in the middle of each, for example if i use for /R %%i in (.) do call "%%i\copyme.bat it tries to run c:\test\1\.\copyme.bat instead of c:\test\1\copyme.bat.
how do i remove the .\ from the variable or is there another way to do this? unfortunately as this will run on many different hard drives taken from many different computers before backing up and reinstalling windows, each time the user folders will be different plus sometimes there will be multiple users. There is no point in backup up temp Internet files, temp folder and other junk, so i want to delete it before copying, since i do this several times in a day it will save much time. i just made a Windows folder cleanup and used it on a customer's 85GB Backup and without deleting anything useful like system32 and inf, etc i managed to get the backup down to 30GB and saved copying all those files and folders, now i am working on the batch file for cleaning up User folders but since it's a variable i need to solve the problem in a different way.
thanks