Add Terminal Launcher - Windows desktop launcher for WSL, PowerShell, Ubuntu
Simple double-click launchers for opening terminal environments: Files: - TerminalLauncher.vbs: VBScript launcher (no dependencies) - RECOMMENDED - TerminalLauncher.py: Python GUI with three buttons - TerminalLauncher.bat: Batch wrapper for Python version - TERMINAL_LAUNCHER_SETUP.md: Complete setup and usage guide Features: ✓ Double-click to open ✓ VBScript version requires no external dependencies ✓ Python version provides prettier GUI with buttons ✓ Three terminal options: WSL (default), PowerShell, Ubuntu (WSL) ✓ Works on Windows 7 and later Usage: 1. Copy .vbs or .bat/.py to Windows Desktop 2. Double-click 3. Select terminal 4. Opens immediately Ready for production use.
This commit is contained in:
@@ -0,0 +1,167 @@
|
||||
# Terminal Launcher - Setup Guide
|
||||
|
||||
## Quick Start (2 Options)
|
||||
|
||||
### Option 1: VBScript (No Python Required) ⭐ RECOMMENDED
|
||||
**Fastest, simplest, most reliable**
|
||||
|
||||
1. Copy `TerminalLauncher.vbs` to your **Windows Desktop**
|
||||
2. Double-click it
|
||||
3. Enter `1`, `2`, or `3` to select terminal
|
||||
4. Done!
|
||||
|
||||
**No dependencies. Works on any Windows system.**
|
||||
|
||||
---
|
||||
|
||||
### Option 2: Python GUI (Prettier UI)
|
||||
**Requires Python 3 installed**
|
||||
|
||||
1. Copy both files to your **Desktop**:
|
||||
- `TerminalLauncher.py`
|
||||
- `TerminalLauncher.bat`
|
||||
|
||||
2. Double-click `TerminalLauncher.bat`
|
||||
|
||||
3. Click button to launch terminal
|
||||
|
||||
**Requires: Python 3.x with tkinter (usually installed by default)**
|
||||
|
||||
---
|
||||
|
||||
## Files Included
|
||||
|
||||
### TerminalLauncher.vbs
|
||||
- **VBScript** launcher (Windows native)
|
||||
- Zero dependencies
|
||||
- Opens input dialog for selection
|
||||
- **Recommended for simplicity**
|
||||
|
||||
### TerminalLauncher.py
|
||||
- Python GUI with three buttons
|
||||
- Prettier interface
|
||||
- Requires Python 3
|
||||
- Auto-closes after launching
|
||||
|
||||
### TerminalLauncher.bat
|
||||
- Batch wrapper for Python version
|
||||
- Handles path and error messages
|
||||
- Double-click to run
|
||||
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
### VBScript Version
|
||||
```
|
||||
Double-click TerminalLauncher.vbs
|
||||
→ Input dialog appears
|
||||
→ Enter: 1 = WSL, 2 = PowerShell, 3 = Ubuntu
|
||||
→ Terminal opens
|
||||
```
|
||||
|
||||
### Python Version
|
||||
```
|
||||
Double-click TerminalLauncher.bat
|
||||
→ GUI window appears with 3 buttons
|
||||
→ Click button to open terminal
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## What Each Option Does
|
||||
|
||||
| Button | Action |
|
||||
|--------|--------|
|
||||
| **WSL (Default)** | Opens WSL with default distro |
|
||||
| **PowerShell** | Opens Windows PowerShell |
|
||||
| **Ubuntu (WSL)** | Opens Ubuntu via WSL |
|
||||
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
### On Desktop (Simplest)
|
||||
1. Download `TerminalLauncher.vbs` (or `.bat` + `.py`)
|
||||
2. Right-click Desktop → New → Shortcut
|
||||
3. Paste file path
|
||||
4. Name it "Terminal Launcher"
|
||||
5. Done!
|
||||
|
||||
### Create Windows Shortcut (Advanced)
|
||||
If you want a custom icon:
|
||||
|
||||
```
|
||||
Target: C:\full\path\to\TerminalLauncher.vbs
|
||||
Start in: C:\full\path\
|
||||
Icon: cmd.exe
|
||||
```
|
||||
|
||||
Or for Python version:
|
||||
```
|
||||
Target: python.exe C:\full\path\to\TerminalLauncher.py
|
||||
Start in: C:\full\path\
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Command not found: wsl"
|
||||
- WSL not installed
|
||||
- Solution: Run `wsl --install` in PowerShell as admin
|
||||
|
||||
### "Command not found: powershell"
|
||||
- Very unlikely (built into Windows)
|
||||
- Solution: Ensure Windows 7 or later
|
||||
|
||||
### Python version doesn't start
|
||||
- Python not in PATH
|
||||
- Solution: Run `python --version` in cmd to verify
|
||||
- Or: Use VBScript version instead (no Python needed)
|
||||
|
||||
### Ubuntu not found
|
||||
- WSL Ubuntu distro not installed
|
||||
- Solution: Run `wsl --list --verbose` to see available distros
|
||||
- Or: Use WSL instead, or install Ubuntu distro
|
||||
|
||||
---
|
||||
|
||||
## System Requirements
|
||||
|
||||
### VBScript Version
|
||||
- ✅ Windows XP or later
|
||||
- ✅ WSL 1/2 (for WSL option)
|
||||
- ✅ PowerShell (included in Windows)
|
||||
|
||||
### Python Version
|
||||
- ✅ Windows 7 or later
|
||||
- ✅ Python 3.5+ (with tkinter)
|
||||
- ✅ WSL 1/2 (for WSL option)
|
||||
|
||||
---
|
||||
|
||||
## Advanced: Create Custom Launcher
|
||||
|
||||
To add more environments, edit the VBScript:
|
||||
|
||||
```vbscript
|
||||
Case "4"
|
||||
objShell.Run "cmd", 1, False ' Add Command Prompt
|
||||
```
|
||||
|
||||
Or edit the Python file to add more buttons.
|
||||
|
||||
---
|
||||
|
||||
## Support
|
||||
|
||||
If having issues:
|
||||
1. Try the **VBScript version** first (no dependencies)
|
||||
2. Verify WSL is installed: `wsl --version`
|
||||
3. Verify PowerShell works: `powershell`
|
||||
4. Check Windows is up to date
|
||||
|
||||
---
|
||||
|
||||
**Ready to use. Just download, copy to Desktop, and double-click!**
|
||||
@@ -0,0 +1,12 @@
|
||||
@echo off
|
||||
REM Terminal Launcher - Double-click to open
|
||||
REM Launches TerminalLauncher.py with Python
|
||||
|
||||
cd /d "%~dp0"
|
||||
python TerminalLauncher.py
|
||||
if errorlevel 1 (
|
||||
echo Failed to launch Terminal Launcher
|
||||
echo Make sure Python is installed and in your PATH
|
||||
pause
|
||||
)
|
||||
exit
|
||||
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Terminal Launcher - Simple GUI for opening WSL, PowerShell, Ubuntu
|
||||
Double-click to run on Windows
|
||||
"""
|
||||
|
||||
import tkinter as tk
|
||||
from tkinter import messagebox
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
|
||||
class TerminalLauncher:
|
||||
def __init__(self, root):
|
||||
self.root = root
|
||||
self.root.title("Terminal Launcher")
|
||||
self.root.geometry("350x220")
|
||||
self.root.resizable(False, False)
|
||||
|
||||
# Center window on screen
|
||||
self.root.update_idletasks()
|
||||
x = (self.root.winfo_screenwidth() // 2) - (self.root.winfo_width() // 2)
|
||||
y = (self.root.winfo_screenheight() // 2) - (self.root.winfo_height() // 2)
|
||||
self.root.geometry(f"+{x}+{y}")
|
||||
|
||||
# Title
|
||||
title = tk.Label(root, text="Terminal Launcher", font=("Segoe UI", 16, "bold"))
|
||||
title.pack(pady=20)
|
||||
|
||||
# Buttons
|
||||
self.btn_wsl = tk.Button(
|
||||
root,
|
||||
text="🖥️ WSL (Default)",
|
||||
width=30,
|
||||
height=2,
|
||||
font=("Segoe UI", 11),
|
||||
command=self.launch_wsl
|
||||
)
|
||||
self.btn_wsl.pack(pady=8)
|
||||
|
||||
self.btn_powershell = tk.Button(
|
||||
root,
|
||||
text="⚡ PowerShell",
|
||||
width=30,
|
||||
height=2,
|
||||
font=("Segoe UI", 11),
|
||||
command=self.launch_powershell
|
||||
)
|
||||
self.btn_powershell.pack(pady=8)
|
||||
|
||||
self.btn_ubuntu = tk.Button(
|
||||
root,
|
||||
text="🐧 Ubuntu (WSL)",
|
||||
width=30,
|
||||
height=2,
|
||||
font=("Segoe UI", 11),
|
||||
command=self.launch_ubuntu
|
||||
)
|
||||
self.btn_ubuntu.pack(pady=8)
|
||||
|
||||
def launch_wsl(self):
|
||||
try:
|
||||
subprocess.Popen("wsl", shell=True)
|
||||
self.root.quit()
|
||||
except Exception as e:
|
||||
messagebox.showerror("Error", f"Failed to launch WSL:\n{e}")
|
||||
|
||||
def launch_powershell(self):
|
||||
try:
|
||||
subprocess.Popen("powershell", shell=True)
|
||||
self.root.quit()
|
||||
except Exception as e:
|
||||
messagebox.showerror("Error", f"Failed to launch PowerShell:\n{e}")
|
||||
|
||||
def launch_ubuntu(self):
|
||||
try:
|
||||
subprocess.Popen("wsl -d Ubuntu", shell=True)
|
||||
self.root.quit()
|
||||
except Exception as e:
|
||||
messagebox.showerror("Error", f"Failed to launch Ubuntu:\n{e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
root = tk.Tk()
|
||||
app = TerminalLauncher(root)
|
||||
root.mainloop()
|
||||
@@ -0,0 +1,30 @@
|
||||
' Terminal Launcher - VBScript
|
||||
' Double-click to launch - no dependencies required
|
||||
' Works on any Windows system
|
||||
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
|
||||
' Display menu using VBScript InputBox with selection
|
||||
Dim result
|
||||
result = InputBox("Select Terminal to Launch:" & vbCrLf & vbCrLf & _
|
||||
"1 = WSL (default)" & vbCrLf & _
|
||||
"2 = PowerShell" & vbCrLf & _
|
||||
"3 = Ubuntu (WSL -d Ubuntu)", _
|
||||
"Terminal Launcher", "1")
|
||||
|
||||
If result = "" Then
|
||||
WScript.Quit
|
||||
End If
|
||||
|
||||
Select Case result
|
||||
Case "1"
|
||||
objShell.Run "wsl", 1, False
|
||||
Case "2"
|
||||
objShell.Run "powershell", 1, False
|
||||
Case "3"
|
||||
objShell.Run "wsl -d Ubuntu", 1, False
|
||||
Case Else
|
||||
MsgBox "Invalid selection. Please enter 1, 2, or 3.", vbExclamation, "Terminal Launcher"
|
||||
End Select
|
||||
|
||||
WScript.Quit
|
||||
Reference in New Issue
Block a user