uEFI Shell scripts (3 of 3)

Scripts are the simplest way to automate any manual task in the uEFI shell environment.

It is always possible to port your tool to work in uEFI environment as a standalone application but there might be requirements where a small script must be run to collect some values or invoke some applications.

All the details of how to work with uEFI Shell can be found in the below pdf link:


startup.nsh script to check for the existence of a file named “exist.txt” and echo its response accordingly:

We can manually execute any script file by typing its name or the Shell always looks for the script file named “startup.nsh” at startup. As shown in the previous post these behaviors can be changed by modifying the Shell code itself.

We mount the hda.disk on mp1 and copy the startup.nsh file along with exist.txt file. The script is executed by the uEFI Shell. The ‘for’ loop scans all the file systems from 0 to 20 and the ‘if’ statement inside checks for the existence of the exist.txt file, if found the Shell goes into that directory and jumps to the label FOUND.

In future posts I will show how to port you existing applications for Windows and Linux to work in uEFI environment.

Leave a comment and I will get back to you.

Leave A Reply

Your email address will not be published. Required fields are marked *