Help with a VBS file to read/write to the Registry 
Author Message
 Help with a VBS file to read/write to the Registry

Hi everyone,

I'm trying to write a VB script which gets the path for the Palm folder
(Palm Pilot) from
the registry, and uses this info to create:
- a new folder in the Palm folder
- and a registry key which points to the new folder.
This requires that the VBS file read the relevant registry key, and use the
information from this registry key to create the new folder and the new
registry key.
Could anyone tell me where to start?
Thanks in advance,

Nat



Sun, 21 Apr 2002 03:00:00 GMT  
 Help with a VBS file to read/write to the Registry
VBS does not natively support access to registry - it is unsafe.

Quote:
> Hi everyone,

> I'm trying to write a VB script which gets the path for the Palm folder
> (Palm Pilot) from
> the registry, and uses this info to create:
> - a new folder in the Palm folder
> - and a registry key which points to the new folder.
> This requires that the VBS file read the relevant registry key, and use
the
> information from this registry key to create the new folder and the new
> registry key.
> Could anyone tell me where to start?
> Thanks in advance,

> Nat



Sun, 21 Apr 2002 03:00:00 GMT  
 Help with a VBS file to read/write to the Registry

The WScript.Shell object has RegRead and RegWrite methods...

--
Michael Harris


  Hi everyone,

  I'm trying to write a VB script which gets the path for the Palm folder
  (Palm Pilot) from
  the registry, and uses this info to create:
  - a new folder in the Palm folder
  - and a registry key which points to the new folder.
  This requires that the VBS file read the relevant registry key, and use the
  information from this registry key to create the new folder and the new
  registry key.
  Could anyone tell me where to start?
  Thanks in advance,

  Nat



Sun, 21 Apr 2002 03:00:00 GMT  
 Help with a VBS file to read/write to the Registry
I'm getting contradictive information here, one reply says that VBS doesn't
have native access to the registry, and the second says WScript.Shell object
can do it.  Is WScript.Shell part of VBS5?  I can't find it in the
documentation.
Thanks,

Nat


The WScript.Shell object has RegRead and RegWrite methods...

--
Michael Harris


Hi everyone,

I'm trying to write a VB script which gets the path for the Palm folder
(Palm Pilot) from
the registry, and uses this info to create:
- a new folder in the Palm folder
- and a registry key which points to the new folder.
This requires that the VBS file read the relevant registry key, and use the
information from this registry key to create the new folder and the new
registry key.
Could anyone tell me where to start?
Thanks in advance,

Nat



Sun, 21 Apr 2002 03:00:00 GMT  
 Help with a VBS file to read/write to the Registry

Both answers are correct.  VBScript is a safe subset of the VB/VBA syntax designed with web page scripting from a browser in mind.  Things like file system or registry access aren't safe in client side web page code, so VBScript has no native support for them.

However, there are numerous additional hosts for VBScript - ASP and WSH being the two most frequently used non-browser hosts.  In these situations, "safety" is not an issue since you can (presumably) trust the source.  

So the 'unsafe" features are provided by external (relative to the scripting engines) COM components that support COM Automation (IDispatch).  WSH provides (via whom.OCX) several COM components ("WScript.Shell" and other "WScript.blahblah" progids).  There is also the Scripting Runtime Library (scrrun.dll) the exposes "Scripting.FileSystemObject" and "Scripting.Dictionary" objects.

In addition, there are other scriptable COM components that are part of the OS or are installed by various applications.  Things like InternetExplorer.Application or Word.Document or ADODB.Recordset.

Since all of these provide inherently "unsafe" features, they aren't usable from within browser hosted script code without some action by (or interaction) with the end user.

The docs for those COM components provided with WSH are available online (and for download in CHM format) at http://msdn.microsoft.com/scripting.  For the WScript components, use the beta docs for WSH2 (the version 1.0 docs - _not_ written by the current WSH development team - leave a lot more than a little to be desired).

--
Michael Harris

  I'm getting contradictive information here, one reply says that VBS doesn't
  have native access to the registry, and the second says WScript.Shell object
  can do it.  Is WScript.Shell part of VBS5?  I can't find it in the
  documentation.
  Thanks,

  Nat



  The WScript.Shell object has RegRead and RegWrite methods...

  --
  Michael Harris



  Hi everyone,

  I'm trying to write a VB script which gets the path for the Palm folder
  (Palm Pilot) from
  the registry, and uses this info to create:
  - a new folder in the Palm folder
  - and a registry key which points to the new folder.
  This requires that the VBS file read the relevant registry key, and use the
  information from this registry key to create the new folder and the new
  registry key.
  Could anyone tell me where to start?
  Thanks in advance,

  Nat



Mon, 22 Apr 2002 03:00:00 GMT  
 Help with a VBS file to read/write to the Registry
WSH Help (WSH.CHM)
Microsoft Windows Script Host
    Windows Script Host Reference
        Methods
            RegDelete
            RegRead
            RegWrite

One thing I always do is read through all the documentation at least once to
familiarize myself with what's available..comprehension, unfortunately, is
always a separate issue.

Marcus


Quote:
> I'm getting contradictive information here, one reply says that VBS
doesn't
> have native access to the registry, and the second says WScript.Shell
object
> can do it.  Is WScript.Shell part of VBS5?  I can't find it in the
> documentation.
> Thanks,

> Nat



> The WScript.Shell object has RegRead and RegWrite methods...

> --
> Michael Harris



> Hi everyone,

> I'm trying to write a VB script which gets the path for the Palm folder
> (Palm Pilot) from
> the registry, and uses this info to create:
> - a new folder in the Palm folder
> - and a registry key which points to the new folder.
> This requires that the VBS file read the relevant registry key, and use
the
> information from this registry key to create the new folder and the new
> registry key.
> Could anyone tell me where to start?
> Thanks in advance,

> Nat



Mon, 22 Apr 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Writing a VBS file which reads and writes to the registry

2. Reading registry and writing it to a text file

3. Reading/Writing to the Registry and .INI file???

4. Reading/Writing to Registry and .INI file ????

5. Read = Write Settings to Registry or Custom File?

6. Help: read or write to the registry

7. Help with Read/Write Settings to Registry

8. Need help with reading/writing different registry values

9. HELP: reading and writing registry items

10. Binary Registry Read/Write Help Needed

11. Help with write&read registry!

12. Reading registry entries from within an HTML help file

 

 
Powered by phpBB® Forum Software