SuperAPI AI Directory

win11-program-launcher

General & other

View repository

Updated 10-16 08:49

About this skill

Win11 Program Launcher

This skill helps Windows 11 users, viabatch scripts (.bat) , launch programs or batch-launch programs with one click, and forcibly close programs.


Use Cases

  • Need to write a batch script on Win11 to launch one or more programs
  • Need to launch multiple programs with one click simultaneously (such as screen recording tools, auxiliary tools, etc.)
  • Need to forcibly close specified programs with one click
  • Create one-click start/stop scripts for "demo/screen recording/development environments"

Core Syntax

1. Launch a program

start /d "程序的所在目录完整路径" 程序名.exe
  • start — Launches a new window to run the program
  • /d — Specifies the program'sstarting working directory(the current directory when the program runs)
  • followed by the .exe filename to execute

Note: If the program path is not in the system PATH, be sure to use /d to specify the directory, otherwise dependency files may not be found.

2. Forcibly close a program

taskkill /f /im 程序名.exe
  • taskkill — Terminates the process
  • /f — Force termination (does not wait for the program to respond)
  • /im — Matches by image name (i.e., process name)

Complete Example: One-Click Start/Stop for Multiple Programs

The following is a real "recording demo video auxiliary tool" script; it first launches three tools, then the lower half closes them all with one click:

@echo off
chcp 65001 >nul

:: ====== 启动程序 ======
start /d "D:\software\PointerFocus\pointerfocus2.4\PointerFocus" PointerFocus.exe
start /d "C:\Users\Administrator\AppData\Local\carnac" Carnac.exe
start /d "D:\software\obs\obs-studio\bin\64bit" obs64.exe

echo 所有程序已启动!
pause

:: ====== 关闭程序 ======
taskkill /f /im obs64.exe
taskkill /f /im PointerFocus.exe
taskkill /f /im Carnac.exe

echo 所有程序已关闭!
pause

@echo off Turn off command echoing,chcp 65001 >nul set the console encoding to UTF-8 to prevent garbled Chinese characters,pause keep the window open waiting for a key press.


Principles for Generating Scripts

When generating scripts for Win11 users, follow these principles:

  1. Always start with @echo off begin with, keeping the output clean
  2. Add chcp 65001 >nul to prevent garbled Chinese characters
  3. Wrap paths in double quotes, to prevent errors with paths containing spaces
  4. Split launching and closing into two sections, separated by :: comments
  5. Use the .batextension (best compatibility, runs directly with a double-click on Win11)
  6. If you are unsure of the directory where a program is located, you can suggest the user locate it using "Open file location" in the Win11 Task Manager
  7. Always put the close script later in the same file, separated by pause , so users can launch first and close everything with one click when done

Interacting with the User

When the user requests "launch a program" or "batch launch":

  1. First ask which programs to launch and their respective installation paths
  2. If the user only provides program names without paths, you can suggest several ways to locate the paths:
    • Start menu → right-click the program → Open file location
    • Task Manager → find the process → right-click → Open file location
    • where 程序名 command (only works for programs in PATH)
  3. Generate a .bat script for the user, placed in a convenient location (such as the desktop or project directory)
  4. Remind the user: double-click .bat to run; right-click to "Run as administrator" (some programs require administrator privileges)