-->

Batch file runs manually but not through Windows 1

2019-08-21 07:03发布

问题:

I really need help on running a .bat file from the Task Scheduler.

It runs when ran from location or when Run is clicked from Task Scheduler.

It doesnt run on a schedule when Run only when user is logged on / Run when user is logged on or not

The user is my local account is also the admin

.bat file is stored in C:\Users\user1\eclipse-workspace\abc\, and this is what iI have filled in for the Program/Script under Settings in Actions tab.

I have unchecked all options under Conditions tab, (tried checking the power options, still didnt work).

I would prefer to have this option set :: Run when user is logged on or not.

I would like to know what I'm missing or where I'm going wrong with this.

.bat file code is :

cd C:\Users\user1\eclipse-workspace\abc
set ProjectPath=C:\Users\user1\eclipse-workspace\abc
echo %ProjectPath%
set classpath=%ProjectPath%\bin;%ProjectPath%\Lib\*
echo %classpath%
java org.testng.TestNG %ProjectPath%\testng.xml
pause