Environment: I have two servers, ServerA and ServerB. ServerA stores my batch scripts and manages my Task Scheduler for automation. ServerB stores several .cmd and .bat files that must be added to the Task Scheduler on ServerA.
Issue: ServerB's .cmd files have local drive references as you'll see below. When called from ServerA's command line, they return errors because the command line is looking for them in ServerA instead of in ServerB. I cannot change these references because they have a considerable number of dependent pieces.
Code:
BatchA.bat:
pushd \\ServerB\d$
call Folder1\Folder2\Folder3\CommandB.cmd
popd
CommandB.cmd:
call D:\Folder1\Folder2\Folder3\batch1.bat
call D:\Folder1\Folder2\Folder3\batch2.bat
call D:\Folder1\Folder2\Folder3\batch3.bat
call D:\Folder1\Folder2\Folder3\batch4.bat
Question: How do I update BatchA.bat to properly call CommandB.cmd from ServerB?