When you type batchfile.bat
on the command line, you are telling cmd.exe
to read the file and execute each line it finds in it. When you double-click on your batch file in explorer, it calls cmd.exe
for you, after reading the file associations in the registry.
Task Manager is not so kind.
So for your task to work, schedule it like this (from memory, not on a Windows box right now) :
cmd /c "c:\full\path\to\your\batchfile.bat"
For extra robustness, you could make sure you batch file run from a known directory, like the one that it reside in, by adding this at the top:
pushd %~dp0
REM .... The original batch file goes here ....
popd
And finally you could disable CMD autorun entry by adding /d
right after cmd
like this:
cmd /d /c "c:\full\path\to\your\batchfile.bat"