diff --git a/doc/openocd.texi b/doc/openocd.texi
index 0608a28d231060c8b04dc45c8b7361cb6d4bf8cd..1248727d3895f27f3bf2273735ea518e79dece6e 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -700,6 +700,7 @@ Configuration files and scripts are searched for in
 @item any search dir specified on the command line using the @option{-s} option,
 @item any search dir specified using the @command{add_script_search_dir} command,
 @item @file{$HOME/.openocd} (not on Windows),
+@item a directory in the @env{OPENOCD_SCRIPTS} environment variable (if set),
 @item the site wide script library @file{$pkgdatadir/site} and
 @item the OpenOCD-supplied script library @file{$pkgdatadir/scripts}.
 @end enumerate
diff --git a/src/helper/options.c b/src/helper/options.c
index bbd071fd8191c96c1e88e09718b6c8fd7763ac85..b13d466d3cb8992ecdbf12d471203b48a1390713 100644
--- a/src/helper/options.c
+++ b/src/helper/options.c
@@ -113,6 +113,12 @@ static void add_default_dirs(void)
 			free(path);
 		}
 	}
+
+	path = getenv("OPENOCD_SCRIPTS");
+
+	if (path)
+		add_script_search_dir(path);
+
 #ifdef _WIN32
 	const char *appdata = getenv("APPDATA");