The CD command and the %cd% variables are useful things to know about. In the FOR command you can use the CD command to make each folder where a batch was found, in turn, the current directory, and thus execute from there. You can get the batch path by using the standard FOR variable modifers ~d and ~p.
Here is the master.bat file that runs the individual user batch scripts
I put it in d:\users
@echo off
echo Starting master.bat
Echo I am master.bat
echo I am stored in: %~dp0
echo I am running from: %cd%
echo Running individual user batches...
set thisfolder=%cd%
for /f "delims=|" %%a in ('dir /B /S new_sendmail1.bat') do cd "%%~dpa" & call "%%a"
cd "%thisfolder%"
echo Back in master.bat
echo Back in folder: %cd%
echo Ended master.bat
pause
This is my dummy new_sendmail1.bat file
identical copies stored in d:\users\george, d:\users\mike, and d:\users\joe
@echo off
echo This is new_sendmail1.bat
echo I am stored in: %~dp0
echo I am running from: %cd%
echo Here's the proof...
dir | find "Directory of"
echo exiting...
This is the output I got
Starting master.bat
I am master.bat
I am stored in: D:\users\
I am running from: D:\users
Running individual user batches...
This is new_sendmail1.bat
I am stored in: D:\users\george\
I am running from: D:\users\george
Here's the proof...
Directory of D:\users\george
exiting...
This is new_sendmail1.bat
I am stored in: D:\users\joe\
I am running from: D:\users\joe
Here's the proof...
Directory of D:\users\joe
exiting...
This is new_sendmail1.bat
I am stored in: D:\users\mike\
I am running from: D:\users\mike
Here's the proof...
Directory of D:\users\mike
exiting...
Back in master.bat
Back in folder: D:\users
Ended master.bat
Press any key to continue . . .