Discussion:
ExpandEnvironmentStrings on Remote Systems?
(too old to reply)
Steve Lynch
2007-05-16 16:11:33 UTC
Permalink
Does anyone know how to accomplish something similar to the
ExpandEnvironmentStrings() function on a remote system? After I read registry
values from a remote computer, I need to expand the variables using the remote
system's environment.

I can't use WMI, I'm looking for something using just the Win32 API.

Thanks!
Kellie Fitton
2007-05-16 18:02:30 UTC
Permalink
Post by Steve Lynch
Does anyone know how to accomplish something similar to the
ExpandEnvironmentStrings() function on a remote system? After I read registry
values from a remote computer, I need to expand the variables using the remote
system's environment.
I can't use WMI, I'm looking for something using just the Win32 API.
Thanks!
Hi,

How about the following function:

ExpandEnvironmentStringsForUser()

http://msdn2.microsoft.com/en-us/library/aa373507.aspx

Kellie.
Steve Lynch
2007-05-16 18:41:27 UTC
Permalink
Post by Kellie Fitton
Post by Steve Lynch
Does anyone know how to accomplish something similar to the
ExpandEnvironmentStrings() function on a remote system? After I read registry
values from a remote computer, I need to expand the variables using the remote
system's environment.
I can't use WMI, I'm looking for something using just the Win32 API.
Thanks!
Hi,
ExpandEnvironmentStringsForUser()
http://msdn2.microsoft.com/en-us/library/aa373507.aspx
Kellie.
Thanks for the reply, but I think ExpandEnvironmentStringsForUser() only works
on the local computer. Unless I'm missing something it can't be used on remote
computers.
Steve Lynch
2007-05-17 21:17:40 UTC
Permalink
Post by Steve Lynch
Does anyone know how to accomplish something similar to the
ExpandEnvironmentStrings() function on a remote system? After I read registry
values from a remote computer, I need to expand the variables using the remote
system's environment.
I can't use WMI, I'm looking for something using just the Win32 API.
Thanks!
I found some of the environment variables in this registry key:
"HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
but it doesn't have them all, especially the ones I'm most interested in like
%SystemDrive% and %SystemRoot%.

I'm still hoping for an API that can work against a remote machine. Any ideas?
Loading...