From 1963b7a4e60dd6afedda22180fae292b4f75eca8 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Tue, 10 Jul 2012 22:48:23 +0000 Subject: [PATCH] [EXPLORER] - Edijs Kolesnikovics: Expand environment strings during processing startup items in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run. See issue #6053 for more details. svn path=/trunk/; revision=56865 --- reactos/base/shell/explorer/services/startup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/base/shell/explorer/services/startup.c b/reactos/base/shell/explorer/services/startup.c index c8f79623dd9..083e6bf4851 100644 --- a/reactos/base/shell/explorer/services/startup.c +++ b/reactos/base/shell/explorer/services/startup.c @@ -364,6 +364,7 @@ static BOOL ProcessRunKeys(HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete, { DWORD nValLength=nMaxValue, nDataLength=nMaxCmdLine; DWORD type; + WCHAR szCmdLineExp[MAX_PATH+1]= L"\0"; --i; @@ -390,7 +391,8 @@ static BOOL ProcessRunKeys(HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete, continue; } - if ((res=runCmd(szCmdLine, NULL, bSynchronous, FALSE))==INVALID_RUNCMD_RETURN) + ExpandEnvironmentStrings(szCmdLine, szCmdLineExp, sizeof(szCmdLineExp)); + if ((res=runCmd(szCmdLineExp, NULL, bSynchronous, FALSE))==INVALID_RUNCMD_RETURN) { printf("Error running cmd #%ld (%ld)\n", i, GetLastError()); }