SendMessage ${HWND_BROADCAST} ${WM_SETTINGCHANGE} 0 "STR:Environment"
设置环境变量,可以使用system插件调用windows api函数SetEnvironmentVariable
示例:
System::Call "Kernel32::SetEnvironmentVariable(t 'TEST_V', t 'TEST_VV') i .r6 ? e"
ReadEnvStr $9 'TEST_V'
MessageBox MB_OK "variable TEST_V has value $9"
弹出提示"variable TEST_V has value TEST_VV"
示例:
System::Call "Kernel32::SetEnvironmentVariable(t 'TEST_V', t 'TEST_VV') i .r6 ? e"
ReadEnvStr $9 'TEST_V'
MessageBox MB_OK "variable TEST_V has value $9"
弹出提示"variable TEST_V has value TEST_VV"
可以看到环境变量已经生效 且此变量可以在 子进程中使用
但在环境变量中不存在