Problem with registry key

Author Message
misza2

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 11/24/2011
  • Status: offline
Problem with registry key Thursday, November 24, 2011 11:42 AM (permalink)
0
Hello , I would like to change registry key using vbs  , but i can't declare value . Every time i try to do this script return with 800a0400 error code  .

This what i have in script :

Dim strNewSignature,test,strRFSignature,WshShell
test = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000002\test"

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite test, "4800460047000000","REG_BINARY"

I have tried to  import reg file but still nothing  . Error code : 80041002

set oFile  = CreateObject("scripting.FileSystemObject")  
set oShell = CreateObject("wscript.shell")
sRegFile = "C:\Users\user\Desktop\signature\registry.REG"
if oFile.FileExists(sregfile) then
iReturn = oShell.Run("regedit.exe" & sRegFile)
if iReturn <> 0 then
wscript.echo "Import Reg Settings Failed! " & err.number & ":" & err.description
end if
else
wscript.echo "Registry Import Failed."
end if
set ofile = nothing
set oshell = nothing

My reg file :

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000002]

"New Signature"=hex:48,00,46,00,47,00,00,00
"Reply-Forward Signature"=hex:48,00,46,00,47,00,00,00

Can You please help my solve it .
 
 
 
#1
    ebgreen

    • Total Posts : 8227
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    Re:Problem with registry key Monday, November 28, 2011 3:38 AM (permalink)
    0
    Which specific line gives you which error?
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      ebgreen

      • Total Posts : 8227
      • Scores: 98
      • Reward points : 0
      • Joined: 7/12/2005
      • Status: offline
      Re:Problem with registry key Monday, November 28, 2011 3:39 AM (permalink)
      0
      And also, WScript.Createobject typically should just be CreateObject.
      "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
      Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
      http://www.visualbasicscript.com/m_47117/tm.htm
       
      #3
        59cobalt

        • Total Posts : 979
        • Scores: 91
        • Reward points : 0
        • Joined: 7/17/2011
        • Status: offline
        Re:Problem with registry key Monday, November 28, 2011 5:51 AM (permalink)
        0
        Using WScript.CreateObject() or just CreateObject() shouldn't make a difference. However, AFAIK writing REG_BINARY values via RegWrite() supports only Integer or Long arguments. "4800460047000000" (even if it's implicitly converted) is far beyond the valid range of a Long value (-2147483648 to 2147483647). The error code could also indicate a number of other issues, though, so the actual error message and the line where the error occurs would indeed be helpful.
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9