WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: seckner on November 06, 2013, 09:40:40 AM

Title: Remote Special Folders
Post by: seckner on November 06, 2013, 09:40:40 AM
I know how to get Special Folders on the system I'm at - how can I get the same on a remote system. I tried writing:

      AddExtender( "WWREG34I.DLL" )
      Computer = "\\" : Computer
      TopKey = @REGMACHINE
      TopSub  = "\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders[Common Desktop]"
      Handle  = RegConnect( Computer, TopKey, "" )
      Path    = RegQueryStr( Handle, TopSub )

I always get back error 1452 : REG Functions : Unable to open specified subkey - I can open the reg remotely and navigate there by hand. Can you see where I'm wrong at? Is there a better way to get the paths? I looked through WMI but couldn't figure out how to get them there.

Thank you for any help!
Title: Re: Remote Special Folders
Post by: Deana on November 06, 2013, 10:11:40 AM
You must make sure the account you are running under has access to the remote registry. Can manually you connect to the remote machine registry using regedit? Reference: http://technet.microsoft.com/en-us/library/cc732388.aspx

You may also need to remove the leading backslash on your subkey path.

Code (winbatch) Select
TopSub  = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders[Common Desktop]"
Title: Re: Remote Special Folders
Post by: seckner on November 06, 2013, 10:51:46 AM
Pure genius - it was the leading backslash that's been beating me raw for the last few hours.. THANK YOU! :)