automatic web starter

I am new to programming with C++. and i want to make something that helps me at the start of the schoolday. I spend days on this problem, but cannot find the awnser. Can please somebody explain me what to do.

What i want the program to do:
The program should check if the time is between the given time.
If true it needs to start a spesific website.
If false the program shuts down.

Problem:
I don't know how to get the weekday, hours and minutes all in there own variable. (seperated) so i can calculate if it should or shouldn't start the website.
And:
I don't know how to get my console to start a link in my browser.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #include <iostream>
  #include <string>
  using namespace std;
  
  int currentHours;   //variable that i want to use for my hours
  int currentMinutes; //variable that i want to use for my minutes
  
  string website = "https://dongemond.magister.net/#/inloggen"; // site that   gives me the locations and time of my lessons
  int openFromHours = 6;    //if i start my computer after 6:00AM it will work
  int openFromMinutes = 00;
  int openUntillHours = 8;  //also it needs to be before 8:30AM.
  int openUntillMinutes = 30;
  
  int main()
  {
      
      return 0;
  }


If your awnser says that i am wrong. Please post it. I don't mind.

Thank you for reading this. Sorry for the bad english. I hope you can help.
I don't know how to get the weekday, hours and minutes all in there own variable. (seperated) so i can calculate if it should or shouldn't start the website.

See:
http://www.cplusplus.com/reference/ctime/mktime/
http://www.cplusplus.com/reference/ctime/tm/

I don't know how to get my console to start a link in my browser.
 
  system ("program files\internet explorer\iexplore.exe google.com");


I am greatfull for your response, but can you give a example. Becouse i don't know that much at coding and i preffer to understand it than copy it.
What i tried first was the time that i didn't understand so i sciped that part for now and focused on the browser.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <string>
#include <stdlib.h>
#include <time.h>
#include <wchar.h>
using namespace std;

int currentHours;   //variable that i want to use for my hours
int currentMinutes; //variable that i want to use for my minutes

int openFromHours = 6;    //if i start my computer after 6:00AM it will work
int openFromMinutes = 00;
int openUntillHours = 8;  //also it needs to be before 8:30AM.
int openUntillMinutes = 30;

int main()
{
    if(true)
    {

        system ("program files\internet explorer\iexplore.exe google.com");
    }
    return 0;

    /* output:
        'program' is not reconized as an dinternal or external command,
        operable program or batch file.

        Process returned 0 (0x0)   execution time : 0.096 s
        Press any key to continue.
    */
}


What am i still doing wrong?
What you can't type on the command line, you can't feed to system.

system("\"/program files/internet explorer/iexplore.exe\" google.com");
Last edited on
Topic archived. No new replies allowed.