Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH Read Registry - How to read keys with \ in them
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00855157
Message ID:
00855725
Views:
18
>>
>>Looks like WSH cannot read/write such keys. See PRB: Unable to Use a "\" in the Key Name with the RegWrite Method of Windows Script Host and http://dbforums.com/arch/196/2002/7/429739 for workarounds.
>
>Sergey,
>
>Thanks for the link. Still, I don't remain convinced that it's a problem with the WSH. The principal reason being that it's simply a COM wrapper for the necessary API calls. Further, since the OS must write and read this particular key (it's the network printer port), the API calls themselves must be able to accomplish this.
>
>My gut reaction is that it's a question of the proper format for the key. The closest analogy I can think of at the moment is long file names with spaces.

George,

In order to pass parameters to underlying API calls, WSH has to split Key Name parameter into Root Key, subkey and Value Name. The Root Key is the Key Name part before the first backslash. WSH wrongly assumes that subkey is everything between the first and last backslash. That's why it gets confused if there're backslashes in the Value Name.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform