E.X.
[Environment] HELLO=BLA ... [Some section] command.0 = cmd.exe description.0 = just a test
if you don't skip user creation (e.g. you create a new user), and you type in set when the cmd window shows up, you won't see the variable HELLO there.
(simple fix - download source and)
Open wihu.c
Find:
LV_EX_ITEM *Parent;
DWORD BlankPasswordUsage = 0;
WIHU_USER *User;
After, add:
LPVOID env = NULL;
Find
while (Env) {
WCHAR EnvData[MAX_ENVVAL_SHORT_SIZE];
ExpandEnvironmentStrings(Env->Value, EnvData, MAX_ENVVAL_SHORT_SIZE);
SetEnvironmentVariable(Env->Key, EnvData);
Env = Env->Next;
}
After, Add (MAKE SURE TO ADD BEFORE } else {:
CreateEnvironmentBlock(&env, NULL, TRUE);
Find
/* Start process in new user account context */
Result = CreateProcessWithLogonW(User->Name, User->Domain, User->Password, LOGON_WITH_PROFILE, NULL, ExeCmd, 0, NULL, CurDir, &sti, &pi);
REPLACE WITH:
/* Start process in new user account context */
Result = CreateProcessWithLogonW(User->Name, User->Domain, User->Password, LOGON_WITH_PROFILE, NULL, ExeCmd, CREATE_UNICODE_ENVIRONMENT, env, CurDir, &sti, &pi);
Recompile source...
Hope that helps some headaches.
Limitation: Generic environment for the user is not loaded, e.g. %USERNAME% will be that of the user that wihu is being run from (use %ThisUser%)



Help
Back to top









