You are here

running .bat file in task scheduler

6 posts / 0 new
Last post
retrorat1
Offline
Has donated long time ago
Joined: 9 years
Last seen: 1 year
running .bat file in task scheduler

Hi guys i need some help, have been looking around and not found anything that helps.

This is the situtation i am running 2 grabs and wanted to set a task scheduler to do it , but since i am running 2 i had to make a .bat file with this

First bat file : Start WebGrab+Plus.exe "C:\Webgrab config files\webgrab sports"

Second bat file : Start  WebGrab+Plus.exe "C:\Webgrab config files\webgrab normal"

coming up with error no config files ( something like that)

But the task schedulerdoes not see the direction to the config files , when i run the bat files manually it works without a problem but i cant schedule it to do it on its own. i know its not a webgrab++ issue but hoping someone will have an answer.

Running windows 7 with the latest webgrab++

Thanks

francis
Offline
francis's picture
Has donated long time agoWG++ Team member
Joined: 12 years
Last seen: 8 months
Is the support helpful?
support us

First, be sure that the config directories, don't need admin privileges.

Second, be sure that your working directory is correct. I would put my working directory in the config file, and use the full path to WebGrab+Plus.exe.

retrorat1
Offline
Has donated long time ago
Joined: 9 years
Last seen: 1 year

Thanks for the quick response Will try that tonight but I made a mistake it actually says can't find webgrab+plus.exe , and I have tried the full path as well but no luck. Read somewhere that task scheduler does not like " ".

P.s If it says cannot find webgrab+plus.exe is it because it is not in the directory where the config file is ? when i wanted only one grab, task scheduler  did that no problem as i pointed it only to webgrab+plus to run, but pointing it to the .bat (file which i uploaded as .txt here) it cant find webgrab+plus.exe . very confused, As the same bat file manually when executed works with no problem.

Attachments: 
retrorat1
Offline
Has donated long time ago
Joined: 9 years
Last seen: 1 year
francis wrote:

First, be sure that the config directories, don't need admin privileges.

Second, be sure that your working directory is correct. I would put my working directory in the config file, and use the full path to WebGrab+Plus.exe.

 

Done the admin bit francis , but i dont understand the working directory bit . The webgrab+plus.exe is in the normal C:\ProgramData\ServerCare\WebGrab and even when i use that path it still says not found it looks like task scheduler is going straight to C:\Webgrab config files\webgrab sports where my config file is but not webgrab program. hope this  makes sense lol. 

Thanks

francis
Offline
francis's picture
Has donated long time agoWG++ Team member
Joined: 12 years
Last seen: 8 months
Is the support helpful?
support us

Just look at the error, that is your problem.

Could not find WebGrab+Plus.exe. It is because it is not at the place you pointed.

This means that the manual run of your bat file will also fail! First be sure the bat file runs manually!

The solution to your problem:

Just put the next line in your bat file and you will be fine

"C:\Program Files (x86)\ServerCare\WebGrab+PlusV1.1.1\WebGrab+Plus.exe" "C:\Webgrab config files\webgrab normal"

Once this bat file runs manually, you can configure the scheduler.

 

What I meant by the working dir:

When you put

WebGrab+Plus.exe "C:\Webgrab config files\webgrab normal"

in your bat file, you must be sure, you are in the

"C:\Program Files (x86)\ServerCare\WebGrab+PlusV1.1.1\"

folder, else, windows wont find the .exe. So when you do that, you must be sure your working dir is at the correct place, before you execute the bat file. When absolute paths, you don't need the working dir stuff.

retrorat1
Offline
Has donated long time ago
Joined: 9 years
Last seen: 1 year

Thanks for the reply, but that is the problem the manual running of the bat file works straight away I use that all the time but does not through task scheduler. Sorry to sound like a broken record but that's where I am stuck

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl