title: Granting local adminstrator permissions to a user for executing a VBS script
body: <p>I am currently working on a LogOn VBScript which has to copy files from one destination to another. Before I start to copy I have to set 2 registry keys. One of them is in HKEY_CURRENT_USER and the other in HKEY_LOCAL_MACHINE. I can write the registry key into HKEY_CURRENT_USER, but not into HKEY_LOCAL_MACHINE because of the permissions of the users. Next thing is that I have to read from a mapped shared folder (e. g. mapped to 'Z:'). If I run the script locally on my computer, I can get the mapped shared folder like this:</p>
  
  <pre><code>Set colDrives = objWMIService.ExecQuery _ 
  ("SELECT * FROM Win32_LogicalDisk WHERE DeviceID = 'Z:'")
  </code></pre>
  
  <p>But when I'm running the script as admin I can't get the mapped folder, but I can write to the registry. Is there any way I can do both tasks with one script?
  I can't change the permissions and one requirement is that everything has to be done with one script.</p>
  
  <p>Thanks in advance!</p>