Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I was doing backups at a clients location today and I noticed one of his staff sitting at the computer repeatedly entering their own web site, immediately exiting and then entering again.
The member did this for about 1/2 an hour.
I eventually asked what she was doing and she advised that the boss gets her to do this at least once a week so that their company name and web site come up on the first page of any one doing a google search for their particular range of products.I thought to my self,
"Surely Self, there is a way for us to automate this?"If all that is required is a staff member logging on and off repeatedly surely a little batch or script file could do the same thing?
Anyone have any ideas ??
or am I way off the track and the staff member has it all wrong
I attempted to create something using this little scripting package CLRScp1 - Clr Script but I get a function error trying to shut the web browser
void Browse(string url)
{
if (!BrowseURL(url, TRUE))
return;
Pause(5000);
if (!BrowserClose(hBrowserIE))
MessageBox("There was an error closing the browser.", "BrowserClose", MB_OK);
}
void main()
{
Browse("http://www.xxxxxxxx.com.au/");
Browse(http://www.xxxxxxxx.com.au/);
The bit where it attempts to close is where the error is
The idea was that it sets up the void paraameter waits 5 seconds, shuts the page down then reloads the page, you would just put 100 or so odd hits in the 'Void" - ideally I would like to not even see the the pages open, just have it run in the background.http://www.clrsoftware.com/clrscrip...
Any and all help will be appreciated
This batch file will start Internet Explorer and navigate to the site of your choice, wait for approximately 5 seconds, close internet explorer and then do it all over again for any number of times:
Change the website= value to the desired url.
Change waittime= value to adjust the delay before closing Internet Explorer. The default value is approx 5 seconds. You may need to adjust this depending upon the speed of the computer/internet connection.
Change the iterations= value to the number of times you want to open/close the desired web page.
=== program starts here ===
@echo off
::*********************************************************
set website=www.yahoo.com
set waittime=100000
set iterations=3
::*********************************************************
set counter=0
:loop
start "c:\program files\internet explorer\iexplore" %website%
for /L %%n in (1,1,%waittime%) do echo %%n
taskkill /im iexplore.exe /f
set /a counter=%counter%+1
if %counter%==%iterations% goto end
goto loop
:end
=== end of program ===Save as filename.bat, where filename is any name you wish...
Report Offensive Follow Up For Removal
Thanks very much KPTECH, you effort is very, very much appreciated. The batch file works well and does exactly what I asked, I wonder however, can the batch file be adapted so that it works equally as well in a Windows XP PRO environment but without the opening of a DOS command prompt window?
Again thank you.
Report Offensive Follow Up For Removal
Sorry for the delay in replying. Was away for a few days...
Not sure how you'd run a batch file without using a command prompt, but the next best thing would be to:
1. Create a shortcut to the batch file.
2. Right click on the shortcut's icon and select properties.
3. Select the Shortcut tab.
4. Select Minimized in the Run: field.
5. Click the OK button.
6. Edit the batch file and add a line at the very end of the file right after the :end label containing only the Exit command, like this:
:end
ExitThis won't keep a command prompt from opening, but it will launch minimized and the "Exit" command will close the window when it's finished. That should make it less of an annoyance.
Report Offensive Follow Up For Removal
Recycled,
My apologies. I was so involved with answering your question, that I forgot my manners.
Anyway, thank you for the kind words, you're very welcome...
Report Offensive Follow Up For Removal
![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |