enviromental access problem
-
I had created variable in user section , using the following code 'defining variables dim objShell, colUserEnvVars 'initializing all variables Set objShell = WScript.CreateObject("WScript.Shell") Set colUserEnvVars = objShell.Environment("System") 'Output File for registry information. colUserEnvVars("rahul") = "rahul" but i cannot read the same from c++, for this i have to restart the system, but Wscript.Echo colUserEnvVars("DeloitteAuditShare123") read the value without restarting ths system.
“You will never be a leader unless you first learn to follow and be led.” –Tiorio "Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
-
I had created variable in user section , using the following code 'defining variables dim objShell, colUserEnvVars 'initializing all variables Set objShell = WScript.CreateObject("WScript.Shell") Set colUserEnvVars = objShell.Environment("System") 'Output File for registry information. colUserEnvVars("rahul") = "rahul" but i cannot read the same from c++, for this i have to restart the system, but Wscript.Echo colUserEnvVars("DeloitteAuditShare123") read the value without restarting ths system.
“You will never be a leader unless you first learn to follow and be led.” –Tiorio "Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
how/from where are you starting the c++ program ? if you dont start it in the same process (maybe that's badly worded) may 'shell'/session ie start it from the VBScript process, it won't have access to the same environment - you would need to have your VBScript modify the 'parent' environment - quite a hard task iirc .. I think you need to look at something like 'setx' http://www.ss64.com/nt/setx.html[^] 'g'
-
I had created variable in user section , using the following code 'defining variables dim objShell, colUserEnvVars 'initializing all variables Set objShell = WScript.CreateObject("WScript.Shell") Set colUserEnvVars = objShell.Environment("System") 'Output File for registry information. colUserEnvVars("rahul") = "rahul" but i cannot read the same from c++, for this i have to restart the system, but Wscript.Echo colUserEnvVars("DeloitteAuditShare123") read the value without restarting ths system.
“You will never be a leader unless you first learn to follow and be led.” –Tiorio "Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
Calling SetEnvironmentVariable has no effect on the system environment variables. To programmatically add or modify system environment variables, add them to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment registry key, then broadcast a WM_SETTINGCHANGE message with lParam set to the string "Environment". This allows applications, such as the shell, to pick up your updates. Note that the values of the environment variables listed in this key are limited to 1024 characters[^]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p