diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index d3ff821135..ce0b8f6d2b 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -1807,6 +1807,14 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) lpFile = sei_tmp.lpFile; wcmd = wcmdBuffer; strcpyW(wcmd, wszApplicationName); + if (sei_tmp.lpDirectory) + { + LPCWSTR searchPath[] = { + sei_tmp.lpDirectory, + NULL + }; + PathFindOnPathW(wcmd, searchPath); + } retval = SHELL_quote_and_execute( wcmd, wszParameters, wszEmpty, wszApplicationName, NULL, &sei_tmp, sei, execfunc ); diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 583504e275..d2c9d370c5 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -2846,7 +2846,7 @@ static void test_directory(void) NULL, "test2.exe", params, tmpdir, NULL); okShell(rc > 32, "returned %lu\n", rc); okChildInt("argcA", 4); - todo_wine okChildString("argvA0", path); + okChildString("argvA0", path); okChildString("argvA3", "Exec"); okChildPath("longPath", path); @@ -2859,7 +2859,7 @@ static void test_directory(void) NULL, "test2.exe", params, "%TMPDIR%", NULL); okShell(rc > 32, "returned %lu\n", rc); okChildInt("argcA", 4); - todo_wine okChildString("argvA0", path); + okChildString("argvA0", path); okChildString("argvA3", "Exec"); okChildPath("longPath", path); @@ -2876,9 +2876,9 @@ static void test_directory(void) NULL, strrchr(argv0, '\\') + 1, params, tmpdir, NULL); okShell(rc > 32, "returned %lu\n", rc); okChildInt("argcA", 4); - todo_wine okChildString("argvA0", path); + okChildString("argvA0", path); okChildString("argvA3", "Exec"); - todo_wine okChildPath("longPath", path); + okChildPath("longPath", path); DeleteFileA(path); }