LMAO...that is good. I found the info from MS about the registry and just
ran with it (below)...both work, so it doesn't really matter to me which one
to use...but now I have another method I can use, plus the sample you
provided snags the printer info too if I ever need it...thanks a ton!
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strComputer & "\root\default:StdRegProv")
Set filesys = CreateObject("Scripting.FileSystemObject")
Set WshSysEnv = WshShell.Environment("PROCESS")
strHomePath = WshSysEnv("HOMEPATH")
strDest = "c:" & strHomePath & "\desktop"
'Backup file of mapped drive paths
strKeyPath = "Network\"
strKeyName = "RemotePath"
objReg.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubKeys
Set MyFile = filesys.CreateTextFile(strDest & "MappedDrives.txt", True)
For Each subkey In arrSubKeys
objReg.GetSTRINGValue HKEY_CURRENT_USER,strKeyPath & "\" &
subkey,strKeyName,szValue
intLength = Len(szValue)-1
strUncPath = Right(szValue, intLength)
MyFile.WriteLine subkey & ":" & strUncPath
Next
MyFile.Close
James
"Eric" <someone@xxxxxx> wrote in message
news:%23VdxzjMIKHA.4708@xxxxxx
> Why hack the info out of the registry? Just use the proper method. MS
> even provides a sample script.
> http://msdn.microsoft.com/en-us/libr...at(VS.85).aspx
>
> "James" <dontemailme@xxxxxx> wrote in message
> news:eo8VaAEIKHA.4708@xxxxxx
>>I did....ran it on several machines running WinXP Pro on our network...its
>>working for me...
>>
>>
>> "Pegasus [MVP]" <news@xxxxxx> wrote in message
>> news:en49aaDIKHA.4708@xxxxxx
>>>
>>> "James" <dontemailme@xxxxxx> wrote in message
>>> news:%23hmR1RDIKHA.3632@xxxxxx
>>>> Thanks Pegasus...
>>>>
>>>> I also found the following
>>>>
>>>> strComputer = "."
>>>> Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
>>>> strComputer & "\root\default:StdRegProv")
>>>> strKeyPath = "Network\"
>>>>
>>>> objReg.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubKeys
>>>> WScript.Echo "Subkeys under " _
>>>> & "HKEY_CURRENT_USER\Network"
>>>> For Each subkey In arrSubKeys
>>>> WScript.Echo subkey
>>>> Next
>>>>
>>>> All I have to do now is for each subkey get the value and write it to a
>>>> file...
>>>>
>>>> YIPEE!
>>>>
>>>> James
>>>
>>> This is the same idea as in your initial post. On my WinXP machine it
>>> won't return any mapped share information. I recommend you test your
>>> script on a few machines before spending much more time on it.
>>> >>
>> >
>