title: Why does WScript work when I run my script from the desktop, but not when run as part of Setup.exe?
body: <p>I've been working on this issue for about 6 hours now and feel like I'm getting nowhere.  I have a vbscript to write to the windows registry that I want to use during the installation of a .net Visual Studio program.  It writes to the Local Machine part of the registry, so permissions have to be edited to accomplish that.  The code in question is as follows:</p>
  
  <pre><code>If Not WScript.Arguments.Named.Exists("elevate") Then
      CreateObject("Shell.Application").ShellExecute WScript.FullName _
          , WScript.ScriptFullName &amp; " /elevate", "", "runas", 1
      WScript.Quit
  End If
  </code></pre>
  
  <p>The code works perfectly when I just run the script from my desktop, and does exactly what I need it to do.  But when I run the setup.exe that includes the script (even if I run setup.exe from my desktop), I get an Object Required error from the WScript code above.  I need to know either 1) why I am getting this error and how to allow access to the WScript object, or if that is impossible 2) how to give my script the proper admin privileges required to write to the Local Machine Registry without using WScript.</p>