DEV Community

Water Run
Water Run

Posted on

Introducing RunOnce: A Frictionless Tool for Running Disposable Scripts

Writing a script used to take half a day — and once written, it would be reused again and again. Back then, the overhead of creating a new file, naming it, and finding a place to store it was negligible compared to the time spent writing the code itself. Things are fundamentally different now.

While LLMs may still struggle with large-scale engineering codebases, a focused, single-purpose script of a few dozen to a few hundred lines is something any reasonably capable model can produce effortlessly. Need to aggregate statistics from a directory? Write a script. Remove image backgrounds? Write a script. Even manipulate an Excel file — write a script. Custom code has never been this cheap to produce, and its lifecycle has shrunk to a single use. So much so that the combined effort of creating a file, running it, and deleting it afterward may actually exceed the effort of writing the script itself. Wouldn't it be ideal to simply open an editor, paste the code, hit run, and be done with it?

Introducing RunOnce — a tool designed precisely for running these disposable, one-off scripts with minimal friction.


RunOnce is available on the Microsoft Store as a free download. Built on the standard WinUI 3 framework, it integrates seamlessly with Windows 11.

Upon installation, a new entry — "Run Code Here" — will appear in your right-click context menu. For example, suppose you need a script to generate various asset images from a logo. Simply right-click in the target directory, select "Run Code Here," and an editor will open. Right-click in the blank area to paste your code, then press Ctrl+Enter. Done.

RunOnce Editor Interface

It really is that straightforward. RunOnce automatically detects the programming language, invokes the appropriate runtime, executes the script, and cleans up any temporary files upon completion. The only prerequisite is that the corresponding language runtime is installed on your system.

In practice, most LLM-generated scripts are written in Python, whose extensive ecosystem of third-party libraries makes it the ideal choice for quick, ad-hoc tasks. That said, RunOnce also supports automatic detection and execution of Lua, Batch (.bat), PowerShell, Nim, and Go, catering to a range of preferences and requirements.


An editor must be editable — and RunOnce honors that principle. The built-in editor provides basic syntax highlighting for quick review and minor edits, such as adjusting input_file or output_file values. It is intentionally minimal: if more substantial changes are needed, it is almost always faster and more reliable to simply ask the LLM to regenerate the script.

RunOnce also supports passing command-line arguments to scripts, should your use case require it — though scripts that accept parameters tend to be less "disposable" by nature, as parameterization often implies the intent to run them more than once.

RunOnce Settings


One important consideration concerns file path handling. By default, RunOnce operates in "Ensure Cleanup" mode, placing temporary script files in the system's temporary directory. Even if cleanup fails due to an unexpected error, the residual files remain out of sight. This mode works well for the vast majority of scripts.

However, if your script contains statements that resolve the script's own path — such as os.path.abspath(__file__) in Python — you should switch to "Ensure Compatibility" mode. In this mode, the temporary file is placed in a more accessible location. Do ensure the terminal closes normally after execution; otherwise, the temporary file may not be cleaned up automatically and will require manual deletion.

RunOnce Advanced Settings


RunOnce is open source under the GPL v3 license, available on GitHub at GitHub - Water-Run/RunOnce: 一次运行 -- 随时随地的运行大模型生成的"一次性"程序. · GitHub. If you find the project useful, a ⭐ Star on GitHub would be greatly appreciated.

Top comments (0)