Batch file help for que program, please

Status
Not open for further replies.

VJS

Ars Scholae Palatinae
1,154
Here is my update on creating a cache program for SOB to help finish of workunits for no-net people. But I'm still having problems....

The idea is to install sob as a service, copy you z-file and know your k/n values.

Proceedure:

1. Copy the z-file only between the machines into/out of the correct sob directory.

2. Note your K/N pair then modify the following batch file. (You can simply cut and past the text bellow into notepad. call it anything you want.bat. Then by clicking on the bat file it will change your registry, and start sob running.

Batch file

******

NET STOP "Seventeen or Bust service"

REG UPDATE HKLM\SOFTWARE\LhDn\sob\config\special_handling=1
REG UPDATE HKLM\SOFTWARE\LhDn\sob\cache\cache=2
REG UPDATE HKLM\SOFTWARE\LhDn\sob\cache\k=24737
REG UPDATE HKLM\SOFTWARE\LhDn\sob\cache\n=5984263

NET START "Seventeen or Bust service"

NET STOP "Seventeen or Bust service"

REG UPDATE HKLM\SOFTWARE\LhDn\sob\config\special_handling=1
REG UPDATE HKLM\SOFTWARE\LhDn\sob\cache\cache=2
REG UPDATE HKLM\SOFTWARE\LhDn\sob\cache\k=67607
REG UPDATE HKLM\SOFTWARE\LhDn\sob\cache\n=5983571

NET START "Seventeen or Bust service"

NET STOP "Seventeen or Bust service"

********

The above batch file was intented to start the first wu, complete it then, process the second.

Unfortunately the batch file or w2k does not wait for the first k/n to finish. It does change the registry, start the wu, but it imediately stop it continues to the next, then stops it again.

I've tried wait commands but I cannot get any of the wait commands to work.

Any suggestions????

VJS
 

pizzaking

Ars Scholae Palatinae
859
Subscriptor
The batch file is doing exactly what it is meant to do. All the net start/stop command does is interface with the service control manager instructing it to start/stop the specified service, display the results of the operation then exit. It isn't concerned with what the service does once it has started (or not started as the case maybe).

pk
 

VJS

Ars Scholae Palatinae
1,154
Great... this I understand and it is what's currently happening, so what I'm asking for is the follwoing.

********

NET START "Seventeen or Bust service"

Some way of telling the batch file to wait;
- until the service has stopped running
- sb.exe is not in the taskmanager
- until CPU usage less than 30% for 60 seconds
- until the z file is tranmitted
- or at least wait a specified time (crude and problematic but not terrible)
Then proceed to the next step

NET STOP "Seventeen or Bust service"

*********

Any ideas??? The WAIT comand doesn't seem to do much good.
 

7im

Ars Tribunus Militum
1,620
One crude way to do this is divide the operation in to two batch files.

Edit each batch file as needed.

Run the first one manually.

Create a scheduled task to run the second batch file. That scheduled task can be set to run the next time the computer goes idle for at least X number of minutes. And it can be set to run only one time, or to stop after specified length of time.

I don't run the that project, but thought I would take a stab at it.

I have used something similar to run more than one set of Folding@Home work units on a no net PC. I launch the first one manually, and then use the scheduled to lauch the next unit after the first unit goes idle.
 

7im

Ars Tribunus Militum
1,620
There is an option to run a scheduled task after the computer becomes idle for a user defineable number of minutes. I am assuming that as long as the first SOB work unit is processing that the computer is working away and not sitting at idle. Also assuming the computer will go idle after that first WU is done, then the scheduled task sees the computer is idle for X minutes, and calls the second batch file to run.

The run after idle option is in the advanced settings of the scheduled task. When you first set this up, configure it to run once a day and ignore the time/date stuff. Open the advanced options. Under the settings tab, there is the option to run when idle, which overrides the date time stuff.

I would suggest playing with a few sets of old data to make sure the process works as expected before using it on live WUs, just so you don't lose any points.

Let me know if you need more detail configuring the scheduled task.
 

Melinate

Ars Scholae Palatinae
884
I have not looked to see what your solution was, but I was just about to suggest something...

you could do something like

:sleep
sleep 30
if exists z###### goto sleep:

This would keep the batch running [without sucking practically any CPU cycles], until the z file is transferred. Then it would continue to process whatever is after the loop [stop service, edit registry, start service]

This will require a "sleep" command [there is no native windows command], but I have one if you need it.

Melinate
 
Status
Not open for further replies.