Set WshShell = WScript.CreateObject("WScript.Shell") dir = "abc" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Installation\InstallPath", "a" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\First Name", "b" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Last Name", "c" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Organization", "d" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Register", "e" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Serial Number", "f" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Validation", "g" WScript.Echo WshShell.RegRead "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Installation\InstallPath" WScript.Echo WshShell.RegRead "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\First Name" WScript.Echo WshShell.RegRead "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Last Name" WScript.Echo WshShell.RegRead "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Organization" WScript.Echo WshShell.RegRead "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Register" WScript.Echo WshShell.RegRead "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Serial Number" WScript.Echo WshShell.RegRead "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Validation" That code gives an error, Line 10, Char 31, 'Expected end of statement'. However, this works fine: Set WshShell = WScript.CreateObject("WScript.Shell") dir = "abc" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Installation\InstallPath", "a" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\First Name", "b" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Last Name", "c" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Organization", "d" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Register", "e" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Serial Number", "f" WshShell.RegWrite "HKLM\SOFTWARE\Macromedia\" & dir & "\6\Registration\Validation", "g" I can't see anything wrong with the first code. Can you? Note that I have changed what is being written to the registry (I don't exactly want to write a,b,c etc.)