Registry 
Author Message
 Registry

RegistryI always use a .reg file.
You can create this file with Regedit by setting the appropriate value then exporting the key.
The .reg file produced is just a text file so you can modify it. The just run the file from you script.
eg.

Sub SetToday()
 On Error resume Next
 sToday = WshShell.RegRead("HKCU\Software\Microsoft\Office\8.0\Outlook\Today\Url")
 If sToday <> "\\Server\Today\Outlook.htm" Then
  WshShell.Run ("Regedit /s \\Server\netlogon\today.reg")
 End If
End Sub

regedit /s prevents any user prompt to confirm the import.
Regards,
Ian
WSH FAQ http://www.*-*-*.com/


  Please help
  I am trying to modify some of the registry information using WSH 2.0 beta. My problem is that the values that I need to modify are of type Binary. I found in the WSh 2.0 documentation that when you issue the command

  wshshell.RegWrite HivePath,value,valuetype
  the value type for binary suppose to be an integer, but nomatter what I do it does not work.It keep given me a type mismatch as an error.

  please help



Wed, 06 Feb 2002 03:00:00 GMT  
 Registry

I was curious: how do you delete entries (such as in an uninstall, etc.) that were added using a .reg file?

    I always use a .reg file.
    You can create this file with Regedit by setting the appropriate value then exporting the key.
    The .reg file produced is just a text file so you can modify it. The just run the file from you script.
    eg.

    Sub SetToday()
     On Error resume Next
     sToday = WshShell.RegRead("HKCU\Software\Microsoft\Office\8.0\Outlook\Today\Url")
     If sToday <> "\\Server\Today\Outlook.htm" Then
      WshShell.Run ("Regedit /s \\Server\netlogon\today.reg")
     End If
    End Sub

    regedit /s prevents any user prompt to confirm the import.
    Regards,
    Ian
    WSH FAQ http://wsh.glazier.co.nz


        Please help
        I am trying to modify some of the registry information using WSH 2.0 beta. My problem is that the values that I need to modify are of type Binary. I found in the WSh 2.0 documentation that when you issue the command

        wshshell.RegWrite HivePath,value,valuetype
        the value type for binary suppose to be an integer, but nomatter what I do it does not work.It keep given me a type mismatch as an error.

        please help



Wed, 06 Feb 2002 03:00:00 GMT  
 Registry

RegistryThe RegDelete method has no problem with any type of registry key/value (except for value names that contain \ as part of the name)...

--
Michael Harris

I was curious: how do you delete entries (such as in an uninstall, etc.) that were added using a .reg file?

  I always use a .reg file.
  You can create this file with Regedit by setting the appropriate value then exporting the key.
  The .reg file produced is just a text file so you can modify it. The just run the file from you script.
  eg.

  Sub SetToday()
   On Error resume Next
   sToday = WshShell.RegRead("HKCU\Software\Microsoft\Office\8.0\Outlook\Today\Url")
   If sToday <> "\\Server\Today\Outlook.htm" Then
    WshShell.Run ("Regedit /s \\Server\netlogon\today.reg")
   End If
  End Sub

  regedit /s prevents any user prompt to confirm the import.
  Regards,
  Ian
  WSH FAQ http://wsh.glazier.co.nz


    Please help
    I am trying to modify some of the registry information using WSH 2.0 beta. My problem is that the values that I need to modify are of type Binary. I found in the WSh 2.0 documentation that when you issue the command

    wshshell.RegWrite HivePath,value,valuetype
    the value type for binary suppose to be an integer, but nomatter what I do it does not work.It keep given me a type mismatch as an error.

    please help



Wed, 06 Feb 2002 03:00:00 GMT  
 Registry

RegistryVarType = 8204 is an array of variants:

12 (vbVariant) + 8192 (vbArray)

TypeName will give you the string "Variant()" to indicate a variant array.

--
Michael Harris

How about _adding_ to an existing REG_MULTI_SZ value? Have you ever tried this? Even though I can read the value using RegRead I'm not able to write it properly to a .reg file since the VarType is something undefined - VarType 8204 - something in between an Array and an Object??? :-)

/Anders

  I always use a .reg file.
  You can create this file with Regedit by setting the appropriate value then exporting the key.
  The .reg file produced is just a text file so you can modify it. The just run the file from you script.
  eg.

  Sub SetToday()
   On Error resume Next
   sToday = WshShell.RegRead("HKCU\Software\Microsoft\Office\8.0\Outlook\Today\Url")
   If sToday <> "\\Server\Today\Outlook.htm" Then
    WshShell.Run ("Regedit /s \\Server\netlogon\today.reg")
   End If
  End Sub

  regedit /s prevents any user prompt to confirm the import.
  Regards,
  Ian
  WSH FAQ http://wsh.glazier.co.nz


    Please help
    I am trying to modify some of the registry information using WSH 2.0 beta. My problem is that the values that I need to modify are of type Binary. I found in the WSh 2.0 documentation that when you issue the command

    wshshell.RegWrite HivePath,value,valuetype
    the value type for binary suppose to be an integer, but nomatter what I do it does not work.It keep given me a type mismatch as an error.

    please help



Thu, 07 Feb 2002 03:00:00 GMT  
 Registry

RegistryHow about _adding_ to an existing REG_MULTI_SZ value? Have you ever tried this? Even though I can read the value using RegRead I'm not able to write it properly to a .reg file since the VarType is something undefined - VarType 8204 - something in between an Array and an Object??? :-)

/Anders

  I always use a .reg file.
  You can create this file with Regedit by setting the appropriate value then exporting the key.
  The .reg file produced is just a text file so you can modify it. The just run the file from you script.
  eg.

  Sub SetToday()
   On Error resume Next
   sToday = WshShell.RegRead("HKCU\Software\Microsoft\Office\8.0\Outlook\Today\Url")
   If sToday <> "\\Server\Today\Outlook.htm" Then
    WshShell.Run ("Regedit /s \\Server\netlogon\today.reg")
   End If
  End Sub

  regedit /s prevents any user prompt to confirm the import.
  Regards,
  Ian
  WSH FAQ http://wsh.glazier.co.nz


    Please help
    I am trying to modify some of the registry information using WSH 2.0 beta. My problem is that the values that I need to modify are of type Binary. I found in the WSh 2.0 documentation that when you issue the command

    wshshell.RegWrite HivePath,value,valuetype
    the value type for binary suppose to be an integer, but nomatter what I do it does not work.It keep given me a type mismatch as an error.

    please help



Fri, 08 Feb 2002 03:00:00 GMT  
 Registry

The hardest part of what I am suggesting is getting the help files from the Windows NT 4 DDK.  This section has how to write INF files:

2.3.1 INF File Format Reference

I use INF files and the command "rundll32 setupapi,InstallHinfSection DefaultInstall 128 .\myfile.INF".  The advantage of INF style changes are they support all of the registry formats, deletes, and can be used to create short-cuts (so can WSH.)  For Multi_Sz, there is FLG_ADDREG_APPEND.  This is specifically for appending more information to REG_MULTI_SZ keys.  Another advantage is that by using the formats, you will get a better grasp of what all the other INF files do for such things as drivers and installation programs.  INFs are one of the first places I start troubleshooting installation problems.  The INF format is also used by SYSDIFF.

    Please help
    I am trying to modify some of the registry information using WSH 2.0 beta. My problem is that the values that I need to modify are of type Binary. I found in the WSh 2.0 documentation that when you issue the command

    wshshell.RegWrite HivePath,value,valuetype
    the value type for binary suppose to be an integer, but nomatter what I do it does not work.It keep given me a type mismatch as an error.

    please help



Fri, 08 Feb 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Read Registry Keys and Trees / API Call for Registry access

2. I have a problem : registry base and outlook signature

3. help please: example of seeing of a registry key exists

4. find the specify Root key and Sub key from the registry

5. Can WMI scripting be used to update registry?

6. VBScript and registry PagingFile Entry....

7. Registry from VBSCRIPT?

8. Registry

9. Reading registry settings using JScript

10. tighter security - capture a unique value from registry

11. How can I Read-Write the registry from a VBScript-Procedure of an outlook-form

12. How can I Read-Write remote registry

 

 
Powered by phpBB® Forum Software