title: How can I delete %appdata%, etc.. folders remotely from a txt list of computers?
body: <p>I am trying to delete multiple folders that will be read from a txt file.  I am not sure how to get it to loop through the computers in the text file while pulling the currently logged on user.  I tried some code but not experience enough to merge it with what I currently have.</p>
  
  <p>I have a working script that deletes folders from a list of computers in a txt file except for the ones with %APPDATA%, etc... which is why I am using vbscript.</p>
  
  <p>Just to note, I am unable to use any software other than what comes installed with Windows 7.  This eliminates psexec, etc...</p>
  
  <p>Any help would be greatly appreciated, thanks!</p>
  
  <pre><code>InputFile = "C:\complist.txt"
  Const DeleteReadOnly = True
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  objFile = objFSO.OpenTextFile(InputFile)
  Do While Not (objFile.AtEndOfStream)
  strComputer = objFile.ReadLine
  On Error Resume Next
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  objFSO.DeleteFolder("\\" &amp; strComputer &amp; "\c$\test")
  objFSO.DeleteFolder("\\" &amp; strComputer &amp; "\c$\%APPDATA%\PGP Corporation")
  objFSO.DeleteFolder("\\" &amp; strComputer &amp; "\c$\%LOCALAPPDATA%\PGP Corporation")
  objFSO.DeleteFolder("\\" &amp; strComputer &amp; "\c$\%USERPROFILE%\Documents\PGP Corporation")
  objFSO.DeleteFolder("\\" &amp; strComputer &amp; "\c$\%ALLUSERSPROFILE%\Application Data\PGP Corporation")
  objFSO.DeleteFolder("\\" &amp; strComputer &amp; "\c$\%ALLUSERSPROFILE%\Start Menu\Programs\PGP")
  objFSO.DeleteFolder("\\" &amp; strComputer &amp; "\c$\%CommonProgramFiles%\PGP Corporation")
  objFSO.DeleteFolder("\\" &amp; strComputer &amp; "\c$\%ProgramFiles%\PGP Corporation")
  objFSO.DeleteFolder("\\" &amp; strComputer &amp; "\c$\Windows\System32\config\systemprofile\AppData\Local\PGP Corporation")
  Err.clean
  Loop
  
  MsgBox "Done"
  </code></pre>