Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - WMI to get folder paths

Reply
 
Old 02-21-2009   #1 (permalink)
TDM


 
 

WMI to get folder paths


Hello all,

I am looking for a way to use WMI via VBScript to query a remote
system for folder paths, specifically to get folders for a user that would
equate to folders suchas "My Document", and the users "%UserProfile%"
folder. I have used the WMI object browser to see if this is possible and
I can find nothing useful. Any and all suggestions are welcome.

Thanks in advance.

TDM

My System SpecsSystem Spec
Old 02-22-2009   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: WMI to get folder paths


"TDM" <rpuffd@xxxxxx> wrote in message
news:eZTsZ2IlJHA.4404@xxxxxx
Quote:

>
> Hello all,
>
> I am looking for a way to use WMI via VBScript to query a remote
> system for folder paths, specifically to get folders for a user that would
> equate to folders suchas "My Document", and the users "%UserProfile%"
> folder. I have used the WMI object browser to see if this is possible and
> I can find nothing useful. Any and all suggestions are welcome.
>
> Thanks in advance.
>
> TDM
Environmental variables such as %UserProfile% are specific to actual user
sessions. I can see two ways to get them:
- You establish a logon session under that user. For this you will need his
password.
- You query the user's registry hive. For this you will need administrative
privileges.
Is this what you want?


My System SpecsSystem Spec
Old 02-22-2009   #3 (permalink)
TDM


 
 

Re: WMI to get folder paths


"Pegasus (MVP)" <I.can@xxxxxx> wrote in message news:ubfCxFMlJHA.3868@xxxxxx
Quote:

>
> "TDM" <rpuffd@xxxxxx> wrote in message
> news:eZTsZ2IlJHA.4404@xxxxxx
Quote:

>>
>> Hello all,
>>
>> I am looking for a way to use WMI via VBScript to query a remote
>> system for folder paths, specifically to get folders for a user that would
>> equate to folders suchas "My Document", and the users "%UserProfile%"
>> folder. I have used the WMI object browser to see if this is possible and
>> I can find nothing useful. Any and all suggestions are welcome.
>>
>> Thanks in advance.
>>
>> TDM
>
> Environmental variables such as %UserProfile% are specific to actual user
> sessions. I can see two ways to get them:
> - You establish a logon session under that user. For this you will need his
> password.
> - You query the user's registry hive. For this you will need administrative
> privileges.
> Is this what you want?
>
>
Pegasus,

Yes, that should work, and I do have the users password entered
by them in a previous section of the script. I was just hoping for
a container similar to Win32_Desktop where you can enumerate
all profiles on the system, but your proposal should work.

Thanks for your reply.


TDM
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Certification paths .NET General
Folder Paths in Windows Explorer Search Results Vista file management
Vim and PowerShell paths PowerShell
Looking for function to resolve VirtualStore paths to physical paths Vista file management
Looking for function to resolve VirtualStore paths to physical paths Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46