Computing.Net > Forums > Windows XP > Creating a script file or the like

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to get for your free account now!

Creating a script file or the like

Reply to Message Icon

Name: Recycled
Date: January 8, 2009 at 16:00:41 Pacific
OS: Microsoft Windows XP Professional
CPU/Ram: 2.666 GHz / 3326 MB
Manufacturer/Model: Gigabyte / P35-ds4
Subcategory: Software Problems
Comment:

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


Report Offensive Message For Removal

Sponsored Link
Ads by Google

Response Number 1
Name: kptech
Date: January 9, 2009 at 10:45:20 Pacific
Reply:

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

Response Number 2
Name: Recycled
Date: January 9, 2009 at 14:23:16 Pacific
Reply:

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

Response Number 3
Name: kptech
Date: January 15, 2009 at 14:04:35 Pacific
Reply:

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
Exit

This 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

Response Number 4
Name: kptech
Date: January 15, 2009 at 14:10:56 Pacific
Reply:

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
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Creating a script file or the like

Need help creating a batch file www.computing.net/answers/windows-xp/need-help-creating-a-batch-file/172372.html

Creating a batch file in XP www.computing.net/answers/windows-xp/creating-a-batch-file-in-xp/48561.html

XP Pro - Creating a .bat file www.computing.net/answers/windows-xp/xp-pro-creating-a-bat-file/82420.html