Using arduino to turn off Laptop screen

Hi im rather new to this kind of arduino use, but im tasked with using an arduino uno to turn off a laptop screen. I have an external proximity sensor that if the user is a certain distance away, the arduino will turn off the screen of my laptop. The code I have so far is pretty simple:

int var = 0;
void setup() {
  Serial.begin(9600);
  
}

void loop() {
  var = analogRead(A0);
  if (var > 60) {
    Serial.println("Please approach booth!");
  }
  else if (var <= 60)  {
    Serial.println("Welcome!");
    //Turn off screen code here

  }
  else  {
    Serial.println("Error!");
  }
  delay(1000);
}

The sensor resolution is 1 inch per 2 units, so if the subject is 2.5 feet away or more just wait but if they are 0 - 2.5 ft I want the screen off. I am not experienced in using powershell, but I found a bat file that will turn off my screen with a single line.

powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)

Im just struggling on figuring out how to open it. Any ideas?

Just wanted to give an update. I found this thread:

http://forum.arduino.cc/index.php?topic=39804.0

and using the code provided (I changed the port from 6 to 4) I have the arduino printing to the powershell terminal. I have the arduino printing the powershell command to open the bat file.

int  var = 0;
void setup() {
  Serial.begin(9600);
  
}

void loop() {
  var = analogRead(A0);
  if (var > 60) {
    Serial.println("Please approach booth!");
  }
  else if (var <= 60)  {
    Serial.println("C:/Users/Tyler/Downloads/Screen.bat");
  }
  else  {
    Serial.println("Error!");
  }
  delay(1000);
}

Is there a way to parse out the command from the serial data being sent?

Is there a way to parse out the command from the serial data being sent?

What is reading the command? Of course, if you can read the serial data, you can parse it. But, why do you need to? You just want to execute it.

Power shell is reading the command. It prints it to powersgell but it doesn't run. I thought you had to parse it to get it to execute. Is this not the case?