Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Open then close new sites with time intervals?  (Read 3548 times)

0 Members and 1 Guest are viewing this topic.

wutttokkk

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Unknown
    Open then close new sites with time intervals?
    « on: June 26, 2012, 07:14:50 PM »
    I want to have a code where it Opens a message box you select yes or no then after selecting yes
    It opens a new webpage, waits 10 seconds, closes it,
    repeat
    then at end have a message box saying finished?

    I kinda got started but can someone help me




    x=msgbox ("BLAH CLICK YES", 4,"blah")
    if x=6 then
    msgbox "d", 0,"Ve"
    Const newTab = &H800
    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Navigate "http://www.google.com/1"
    objIE.Visible = True
    WScript.Sleep 6
    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Navigate "http://www.newopen.com"
    objIE.Visible = True
    WScript.Sleep 6
    objIE.Navigate2 "http://www.miniclip.com/games/kung-fu-statesmen/en/", newTab
    objIE.Visible = False
    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Navigate "http://www.endpage.com"
    objIE.Visible = True
    Set objShell = WScript.CreateObject("WScript.Shell")
    objShell.Run("C:\test.bat"), 0, True
    elseif x=7 then
    msgbox "Exit ?", 0,"Are you sure?"
    end if

    Lemonilla



      Apprentice

    • "Too sweet"
    • Thanked: 70
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 7
    w/e this thread is named
    « Reply #1 on: June 26, 2012, 08:07:27 PM »
    Haven't found a way to make a pop-up prompt other than 'start akfh.bat' which you can do, but things get messy quickly. I'll post both methods.

    Code: [Select]
    @echo off
    start
    cls
    echo THIS IS WHERE YOU DISPLAY YOUR QUESTION
    choice
    if %errorlevel% EQU 1 goto open
    if %errorlevel% EQU 2 goto wait

    :open
    start www.YOURWEBSITE.com
    timeout /t 10 /nobreak >nul
    REM if you do not have windows 7 you will have to replace the above line with
    REM "ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127"
    taskkill YOURDEFAULTINTERNETBROWSER.exe
    goto end

    :wait
    timeout /t 10 /nobreak >nul
    REM if you do not have windows 7 you will have to replace the above line with
    REM "ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127 & ping 1.0.0.127"

    :end
    echo Finished?
    choice
    if %errorlevel% EQU 1  goto start
    exit


    Try this out. If you want a prompt that will pop-up try making a seperate file for :open and have a 'start YOURFILE.bat'


    What you started looks to me like java, but I could be wrong.[/code]
    Quote from: patio
    God Bless the DOS Helpers...
    Quote
    If it compiles, send the files.

    wutttokkk

      Topic Starter


      Newbie

      • Experience: Beginner
      • OS: Unknown
      Re: Open then close new sites with time intervals?
      « Reply #2 on: June 26, 2012, 09:14:39 PM »
      Hey thanks alot man i really appreciate it