![]() |
batch file
Hey gurus,
If I reboot the server the internet connection only establishes past 2-3 mins so I have a batch file with the following content to start up the llrnet servers: [code]ping -n 300 127.0.0.1 > NUL Start /min C:\dc\llrnet-windows\Riesel\llrserver.exe ping -n 10 127.0.0.1 > NUL Start /min C:\dc\llrnet-windows\Sierpinski\llrserver.exe ping -n 10 127.0.0.1 > NUL Start /min C:\dc\llrnet-windows\NPLB\llrserver.exe ping -n 10 127.0.0.1 > NUL C:\dc\llrnet-windows\NPLB-port_80\llrserver.exe[/code]The first server (Riesel one) will go online after 300 seconds of the startup of the machine, the second one 310 seconds, the third 320 and so on. My problem here is that the batch opens a DOS windows and never closes because it stays open with details of the console of the last server. By closing that DOS window all servers will go down. How do I avoid this? For now I only have shortcuts of the exe in the startup folder but I prefer to see them on 5 mins past the startup of the machine... |
[quote=em99010pepe;126015]Hey gurus,
If I reboot the server the internet connection only establishes past 2-3 mins so I have a batch file with the following content to start up the llrnet servers: [code]ping -n 300 127.0.0.1 > NUL Start /min C:\dc\llrnet-windows\Riesel\llrserver.exe ping -n 10 127.0.0.1 > NUL Start /min C:\dc\llrnet-windows\Sierpinski\llrserver.exe ping -n 10 127.0.0.1 > NUL Start /min C:\dc\llrnet-windows\NPLB\llrserver.exe ping -n 10 127.0.0.1 > NUL C:\dc\llrnet-windows\NPLB-port_80\llrserver.exe[/code]The first server (Riesel one) will go online after 300 seconds of the startup of the machine, the second one 310 seconds, the third 320 and so on. My problem here is that the batch opens a DOS windows and never closes because it stays open with details of the console of the last server. By closing that DOS window all servers will go down. How do I avoid this? For now I only have shortcuts of the exe in the startup folder but I prefer to see them on 5 mins past the startup of the machine...[/quote] A while back on these forums I posted a copy of [url=http://www.mersenneforum.org/showpost.php?p=113411&postcount=83]a nice little program[/url] that runs in the system tray, and lets you easily hide and unhide windows on demand. It might be just what you're looking for--you can start the servers, then hide them with the program until you want to look at them again, at which point you can easily unhide them. |
Try this Carlos
@echo off ping -n 300 127.0.0.1 > NUL Start /DC:\dc\llrnet-windows\Riesel /I "cmd /cSTART /min llrserver.exe" ping -n 10 127.0.0.1 > NUL Start /DC:\dc\llrnet-windows\Sierpinski /I "cmd /cSTART /min llrserver.exe ping -n 10 127.0.0.1 > NUL Start /DC:\dc\llrnet-windows\NPLB /I "cmd /cSTART /min llrserver.exe ping -n 10 127.0.0.1 > NUL Start /DC:\dc\llrnet-windows\NPLB-port_80 /I "cmd /cSTART /min llrserver.exe echo done! &echo. echo Sleeping for 5 seconds ping -n 5 127.0.0.1 >NUL |
[quote=IronBits;126831]Try this Carlos
@echo off ping -n 300 127.0.0.1 > NUL Start /DC:\dc\llrnet-windows\Riesel /I "cmd /cSTART /min llrserver.exe" ping -n 10 127.0.0.1 > NUL Start /DC:\dc\llrnet-windows\Sierpinski /I "cmd /cSTART /min llrserver.exe ping -n 10 127.0.0.1 > NUL Start /DC:\dc\llrnet-windows\NPLB /I "cmd /cSTART /min llrserver.exe ping -n 10 127.0.0.1 > NUL Start /DC:\dc\llrnet-windows\NPLB-port_80 /I "cmd /cSTART /min llrserver.exe echo done! &echo. echo Sleeping for 5 seconds ping -n 5 127.0.0.1 >NUL[/quote] I'll try this when I reboot the server, I'll let you know when. Thank you DJ. Carlos |
[QUOTE=em99010pepe;126015]Hey gurus,
If I reboot the server the internet connection only establishes past 2-3 mins so I have a batch file with the following content to start up the llrnet servers: [code]ping -n 300 127.0.0.1 > NUL Start /min C:\dc\llrnet-windows\Riesel\llrserver.exe ping -n 10 127.0.0.1 > NUL Start /min C:\dc\llrnet-windows\Sierpinski\llrserver.exe ping -n 10 127.0.0.1 > NUL Start /min C:\dc\llrnet-windows\NPLB\llrserver.exe ping -n 10 127.0.0.1 > NUL C:\dc\llrnet-windows\NPLB-port_80\llrserver.exe[/code]The first server (Riesel one) will go online after 300 seconds of the startup of the machine, the second one 310 seconds, the third 320 and so on. My problem here is that the batch opens a DOS windows and never closes because it stays open with details of the console of the last server. By closing that DOS window all servers will go down. How do I avoid this? For now I only have shortcuts of the exe in the startup folder but I prefer to see them on 5 mins past the startup of the machine...[/QUOTE]The last command does not have the "Start /min" as a prefix so the CMD box will wait for it to finish. |
[quote=retina;126847]The last command does not have the "Start /min" as a prefix so the CMD box will wait for it to finish.[/quote]
Thanks! |
Primes.bat for windows
Don't laugh, it works. This will show you all the primes in results.txt.
I can change it so that it takes a filename.ext from the command line if you would rather have that. sample output: user=Free-DC_Beyond [02/25/08 19:48:38] 861*2^316774-1 is prime! Done! [FONT=Courier New][SIZE=1][SIZE=2]@echo off cls for /f "tokens=1-5* delims=^= " %%a in ('type results.txt') do CALL :PARSE "%%a" "%%b" "%%c" "%%d" goto :END :PARSE if "%~1"=="user" set USER=%~2 if not "%~4"=="prime!" set DATETIME=%~1 %~2 if "%~4"=="prime!" echo user=%USER% & echo %DATETIME% & echo %~1 %~2 %~3 %~4 & set USER=& set DATETIME=&echo. goto :EOF :END echo Done! :EOF [/SIZE] [/SIZE][/FONT] |
[code]@echo off
ping -n 300 127.0.0.1 > NUL Start /DC:\dc\llrnet-windows\NPLB /I cmd /cSTART /min llrserver.exe echo done! &echo. echo Sleeping for 5 seconds ping -n 5 127.0.0.1 >NUL[/code] This works! Thanks IronBits. |
| All times are UTC. The time now is 11:12. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.