title: Using a native Win7 batch to find a users profile registry entry and delete it?
body: <p>I'm creating a batch where part of it locates the registry entries tied in with the user profile and removes them. The other part simply renames the profile folder under C:\Users so the My Docs and Desktop data can be copied back over to the new one when the user logs in. Renaming saves time by not having to copy the entire users profile to another location - which sometimes can be 30-40GB in size. This is what I've got. It's meant to be ran while logged in as a local admin:</p>
  
  <pre><code>@echo off
  MODE 75,30
  
  :Declarations
  setLocal EnableDelayedExpansion
  set date=%date:~4,2%%date:~7,2%%date:~10,4%%
  color 0a
  
  echo 1. - Recreate a Windows User Profile
  ::Completely removes a User Profile, Logs off, then Restores Data(this will be coded later)
  
  echo.0. - Exits
  
  set /p input=Choose a number and press enter: 
  if %input%==1 goto :1
  if %input%==0 goto :0
  
  :1
  cls
  @echo off
  TITLE Removing Windows Profile
  
  set /p EUID= Enter the users EUID: 
  
  rename "C:\Users\%EUID%" "C:\Users\%EUID%.%DATE%"
  
  cls
  
  echo Complete. User Profile removed.
  
  pause
  
  shutdown -l
  
  0:
  exit
  </code></pre>
  
  <p>So I need to somehow find the registry entries as well (probably right after it renames the user profile) using the provided username, then delete them. I know the registry entries aren't exactly titled by the users login name, so your help would be greatly appreciated! Thanks folks!</p>