Re: Optimize Overhead for database
the script is a BATCH file (.bat)
You can run any program from it. Didn't you ever learn DOS or Unix?
Use a program like Workspace Macro ($25 shareware) to send keystrokes to you database if your website and database software don't take command line launches.
Note programs like access and IIS Manager can take command line parameters already. So all you need to do is to call them from in the file.
Here is a sample batch file to check if my machine needs to reboot because connectivity has been lost and may need a reset
Note it checks 3 sites 3 times to see if it can get through......
-------------------------------
@echo off
:START
echo Testing Yahoo
ping.exe yahooxxxxxx.com -n 3 -w 1000 > D:\rebootcontrol\log\YahooIP.txt
IF NOT EXIST D:\rebootcontrol\log\YahooIP.txt goto TESTFAILED1
findstr /b /c:"Reply from " D:\rebootcontrol\log\YahooIP.txt > nul
IF %errorlevel%==1 goto TESTFAILED1
echo Success
goto end
:TESTFAILED1
echo Testing USNO
ping.exe tychoxxxxxxx.usno.navy.mil -n 3 -w 1000 > D:\rebootcontrol\log\USNOIP.txt
IF NOT EXIST D:\rebootcontrol\log\USNOIP.txt goto TESTFAILED2
findstr /b /c:"Reply from " D:\rebootcontrol\log\USNOIP.txt > nul
IF %errorlevel%==1 goto TESTFAILED2
echo Success
goto end
:TESTFAILED2
echo Testing Google
ping.exe googlexxxxxx.com -n 3 -w 1000 > D:\rebootcontrol\log\GoogleIP.txt
IF NOT EXIST D:\rebootcontrol\log\Google.txt goto TESTFAILED3
findstr /b /c:"Reply from " D:\rebootcontrol\log\GoogleIP.txt > nul
IF %errorlevel%==1 goto TESTFAILED3
echo Success
goto end
:TESTFAILED3
echo Failed
IF NumberOFTries==3 GOTO REBOOT
pause 15
GOTO START
goto end
:REBOOT
call app
:end
echo The end.
pause
-------------------------------
I don't know what operating system you are running windows or unix
but they are very similar
if you need help with batch language just bring up the command line prompt in windows and type help it will come up with all the commands you can use.
After you write the batch file place it in scheduler is
which in windows is under
"program files->accesories->system tools " in your start menu.
Scheduled Tasks.
---------------------------------
If you need any more one of my programmers could probably write the whole kit and kaboodle for you in under a day it wouldn't cost to much.
Last edited by RichAtVNS : 07-20-2008 at 09:37 PM.
|