Alex Rivera | Logout

How to expand environment variables remotely with .NET?

Asked 2011-02-17T15:40:27.423
10

I need a way to expand environment variable on a remote machine.

Suppose I have a path to a folder %appdata%\MyApp\Plugins or %ProgramFiles%\MyCompany\MyApp\Plugins and I want to list files in that folder for audit purposes. The only problem is I want to do it on a remote machine, which however I have admin access to.

An extra question (but not essential) is how to do that for given user on remote machine?

Edit
Report

1 Answer

2

The question doesn't make sense. Environment variables are not per-machine variables. For instance, you can expect %appdata% to point inside the C:\users\ directory, but precisely where obviously depends to the user. Logging in as admin still doesn't help you; that would merely tell you where the admin's %appdata% is.

answered 2011-02-17T15:45:47.297

Your Answer