' Listing 3. Writing an Expandable String to the Registry Set shell = CreateObject("WScript.Shell") shell.RegWrite "HKCU\Test\MyTempFolder", _ "%USERPROFILE%\MyTemp", "REG_EXPAND_SZ"