› Forums › Lua › Understanding Why Lua Worked in One Folder but Not Another on Windows (A Beginner’s Learning Journey)
- This topic is empty.
-
AuthorPosts
-
June 9, 2026 at 3:15 am #6855
Many beginners assume that once a programming language has been downloaded and extracted, they can run it from anywhere on their computer. However, during the process of setting up Lua on Windows, an important issue emerged that taught valuable lessons about directories, executable files, and how Windows locates programs.
This learning post documents that experience and explains the concepts involved.
The Goal
The objective was to install Lua and begin experimenting with simple programs from Programming in Lua, starting with:
print("hello world")Before that could happen, Lua needed to be launched successfully from Command Prompt.
The Starting Point
Lua had already been downloaded and extracted.
The extracted folder contained:
lua55.exe luac55.exe lua55.dll wlua55.exeInitially these files were located in:
C:\Users\SDM\Downloads\lua-5.5.0_Win32_binLater they were copied to:
C:\Users\SDM\Desktopto make access easier.
Issue #1: Lua Was Installed but Would Not Run




After opening Command Prompt, the following command was entered:
lua5.5Windows responded:
'lua5.5' is not recognized as an internal or external command, operable program or batch file.This is one of the most common errors encountered by Windows users.
Understanding the Error
The problem was not that Lua was broken.
The problem was that Windows could not find a program named:
lua5.5The actual executable file was named:
lua55.exeNotice the difference:
Incorrect: lua5.5 Correct: lua55Windows requires the exact executable name.
Issue #2: Being in the Wrong Directory
Another issue appeared when Command Prompt opened at:
C:\>instead of:
C:\Users\SDM\Downloads\lua-5.5.0_Win32_bin>At that moment Windows could not locate:
lua55.exebecause it was searching in the current directory.
Understanding the Current Directory
Think of Command Prompt as standing inside a folder.
If Command Prompt shows:
C:\>it is currently standing in:
C:\Windows automatically searches for executable files in the current location.
If Lua is stored elsewhere, Windows cannot find it.
The Solution: Change Directory
The following command was used:
cd \Users\SDM\Downloads\lua-5.5.0_Win32_binThe prompt changed to:
C:\Users\SDM\Downloads\lua-5.5.0_Win32_bin>Now Windows was standing inside the folder that contained Lua.
Successfully Launching Lua
Once inside the correct directory:
lua55produced:
Lua 5.5.0 Copyright (C) 1994-2025 Lua.org, PUC-Rio >The symbol:
>is Lua’s interactive prompt.
It indicates that Lua is ready to execute commands.
Making Things Easier: Moving Lua to the Desktop



To avoid repeatedly navigating into the Downloads folder, the Lua files were copied to:
C:\Users\SDM\DesktopThe Desktop now contained:
lua55.exe luac55.exe lua55.dll wlua55.exeThis simplified access considerably.
Issue #3: How Do You Open Command Prompt in a Specific Folder?
Many beginners know how to open Command Prompt but do not know how to open it in the exact folder they need.
The solution was surprisingly simple.
Opening Command Prompt from File Explorer
While viewing the Desktop folder in File Explorer:
- Click the address bar.
- Type:
cmd- Press Enter.
Windows automatically opened Command Prompt in that location.
The prompt displayed:
C:\Users\SDM\Desktop>This meant Command Prompt was already standing in the folder containing Lua.
Why This Trick Is Useful
Without this technique, users often have to type:
cd foldernamemultiple times.
Using:
cmdinside File Explorer immediately opens Command Prompt in the correct location.
This saves time and reduces mistakes.
Successfully Launching Lua from the Desktop
Because Command Prompt opened in:
C:\Users\SDM\Desktop>the command:
lua55worked immediately.
Output:
Lua 5.5.0 Copyright (C) 1994-2025 Lua.org, PUC-Rio >No additional navigation was required.
First Successful Lua Program
At the Lua prompt:
print("hello world")Output:
hello worldSuccess!
The Lua interpreter was now working correctly.
Understanding Interactive Interpreters
Lua executes commands immediately.
For example:
print(2 + 3)Output:
5This allows experimentation without creating files.
Python behaves similarly:
>>> print("hello world") hello worldLua:
> print("hello world") hello world
Lessons Learned
This stage of the setup process taught several valuable concepts.
1. Executable Names Matter
Windows requires exact program names.
lua55works.
lua5.5does not.
2. Current Directory Matters
Windows searches the current folder for executable programs.
If the executable is elsewhere, it may not be found.
3. The cd Command Changes Location
cd foldernamemoves Command Prompt into another folder.
4. File Explorer Can Launch Command Prompt
Typing:
cmdinto the File Explorer address bar is one of the easiest ways to open Command Prompt in a specific folder.
5. Interactive Programming Is Powerful
The Lua prompt:
>allows immediate experimentation and learning.
Final Success State
The final working environment looked like:
C:\Users\SDM\Desktop>lua55 Lua 5.5.0 Copyright (C) 1994-2025 Lua.org, PUC-Rio >And the first successful Lua program was:
print("hello world")which produced:
hello worldAt this point, the installation and setup phase was complete. The focus could now shift from troubleshooting Windows commands to learning Lua itself—variables, functions, recursion, tables, modules, and real-world programming projects. 🚀
-
AuthorPosts
- You must be logged in to reply to this topic.
