o4-mini-2025-04-16· OpenAI
LMArena Human Preference 140K
create cmd file which will open random txt file for directory where it launched
- User
create cmd file which will open random txt file for directory where it launched
- Assistant
Here’s a tiny Windows batch‐script (
.cmd) that, when launched in any folder, will pick a random.txtfile from that folder and open it with your default text editor (or Notepad if you prefer):@echo off setlocal EnableDelayedExpansion rem ────────────────────────────────────────────── rem 1) Collect all the .txt files in an array rem ────────────────────────────────────────────── set count=0 for %%F in (*.txt) do ( set /a count+=1 set "file[!count!]=%%F" ) rem ────────────────────────────────────────────── rem 2) If none found, bail out rem ────────────────────────────────────────────── if %count% EQU 0 ( echo No .txt files found in "%cd%". pause exit /b 1 ) rem ────────────────────────────────────────────── rem 3) Pick a random index and open that file rem ────────────────────────────────────────────── set /a idx=(%RANDOM% %% count) + 1 set "selected=!file[%idx%]!" echo Opening "%selected%"... start "" "%selected%" endlocal
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.