mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
[EXPLORER]
Expand the environment variables when running startup programs Patch by Edijs Kolesnikovics, slightly modified by me See issue #6953 for more details. svn path=/trunk/; revision=56353
This commit is contained in:
parent
13e0a82ad5
commit
dda26dddae
|
@ -243,6 +243,9 @@ static int runCmd(LPWSTR cmdline, LPCWSTR dir, BOOL wait, BOOL minimized)
|
|||
STARTUPINFOW si;
|
||||
PROCESS_INFORMATION info;
|
||||
DWORD exit_code=0;
|
||||
WCHAR szCmdLineExp[MAX_PATH+1]= L"\0";
|
||||
|
||||
ExpandEnvironmentStrings(cmdline, szCmdLineExp, sizeof(szCmdLineExp));
|
||||
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.cb=sizeof(si);
|
||||
|
@ -253,7 +256,7 @@ static int runCmd(LPWSTR cmdline, LPCWSTR dir, BOOL wait, BOOL minimized)
|
|||
}
|
||||
memset(&info, 0, sizeof(info));
|
||||
|
||||
if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, dir, &si, &info))
|
||||
if (!CreateProcessW(NULL, szCmdLineExp, NULL, NULL, FALSE, 0, NULL, dir, &si, &info))
|
||||
{
|
||||
printf("Failed to run command (%ld)\n", GetLastError());
|
||||
|
||||
|
@ -261,7 +264,7 @@ static int runCmd(LPWSTR cmdline, LPCWSTR dir, BOOL wait, BOOL minimized)
|
|||
}
|
||||
|
||||
printf("Successfully ran command\n"); //%s - Created process handle %p\n",
|
||||
//wine_dbgstr_w(cmdline), info.hProcess);
|
||||
//wine_dbgstr_w(szCmdLineExp), info.hProcess);
|
||||
|
||||
if (wait)
|
||||
{ /* wait for the process to exit */
|
||||
|
|
Loading…
Reference in a new issue