Batch File Help

I’m looking to startup a couple of program from one batch file with just one click.
ie Start Folding SMP client then open FahMon from the desktop.

From online help and using the Folding SMP install.bat as a template, would the following work?

@echo off
cd "C:\Program Files\FahMon"
fahmon.exe
cd "C:\Program Files\Folding"
fah.exe -forceasm

Would that open both then let Fah have the cmd window to display all it’s stuff? And how can I add a 10 second wait before the Folding client starts so FahMon can get sorted?

@echo off
cd "C:\Program Files\FahMon"
fahmon.exe
cd "C:\Program Files\Folding"
fah.exe -forceasm

you could add pause

so it would be :

@echo off
cd "C:\Program Files\FahMon"
fahmon.exe
pause
cd "C:\Program Files\Folding"
fah.exe -forceasm

and after fahmon comes online then all you would have to do is hit any key on the keyboard and the batch file will continue…

im sure theres another way but as its still before 12 I have to turn my brain on!

I searched around on a related issue and found a solution… just found it again for you.


SUCCESS!

I downloaded this program:
ftp://ftp.sac.sk/pub/sac/utiltask/sleep_47.zip

Extracted the zip file and copied SLEEP.EXE to the floppy.

Then I could add the line

SLEEP FOR 5


There were other solutions using the ping command but this seemed the best way of dealing with it for me

Cheers Peige…
But where should I put the program as I’m not using it on a floppy. It’s on Vista.

I’d seen the Ping method but it seemed a bit inelegant.

well i guess if you full path it ie c:\odds\sleep.exe you could put it anywhere, i’m not sure where vista will naturally look if you don’t specify a path and i’m on a XP rig here so I can’t really look for you.

Try this , save it as a vbs

On Error Resume next

Set WSHShell = WScript.CreateObject("WScript.Shell")

Dim Runme

Runme = Chr(34) & "C:\Program Files\FahMon\fahmon.exe" & Chr(34)

intRunError = WSHShell.Run(runme, 1, False)

If intRunError <> 0 Then
	strmsg = "failed"
	Else
	StrMsg = "completed"
End If

WScript.Sleep(15000)

Runme = Chr(34) & "C:\Program Files\Folding\fah.exe -forceasm" & Chr(34)

intRunError = WSHShell.Run(runme, 1, False)

If intRunError <> 0 Then
	strmsg = "failed"
	Else
	StrMsg = "completed"
End If

Even Vista still has the CHOICE command:
CHOICE /D Y /N /T 10 >nul: would do it (the redirect stops it displaying a “Y” when it times out). You also have the option to press “Y” or “N” to end the delay immediately.

Cheers Kevin :slight_smile:

Thus

@echo off
cd "C:\Program Files\FahMon"
fahmon.exe
CHOICE /D Y /N /T 10 >nul:
cd "C:\Program Files\Folding"
fah.exe -forceasm

should work and give a 10 second delay?

That should do it.

Cheers :slight_smile: