As project need, I need to create some batch job like a.bat, b.bat.
and I use Task Scheduler to call these batch job.
but find call failed.
I check the reason that the batch job file will call other file.and cannot find the path.
for example a.bat
@echo off
call Variable.bat
set a=1
set b=2
.........
The error said Variable.bat cannot find.
I know use
@echo off
cd filepath
call Variable.bat
set a=1
set b=2
.........
can solve that problem.
but different server the file path are different, every time change server,then need to change path again. if have many batch jobs ,then change path need to much time.
Do have some other way to solve this ?
When change different server, I don't need change any batch job code
Note:
just double click .bat file can working.
the Task Scheduler seems need start file folder