I'm attempting to remove google chrome from all machines in our corporate enviroment.. First it cycles to find the user accounts, then it cycles through the Application folder for different Chrome versions. For now I'm just copying a file to directory for testing purposes, but it will not exit the loop if version folders are detected. Sorry if not very clear, first time poster, long time lurker :-) Here's my code:
$dirlist = FileFindFirstFile("C:\Users\*.*")
If $dirlist <> -1 Then
While 1
$dir = FileFindNextFile($dirlist)
If @error Then ExitLoop
If FileExists("C:\Users\" & $dir & "\AppData\Local\Google\Chrome\Application") Then
$verlist = FileFindFirstFile("C:\Users\" & $dir & "\AppData\Local\Google\Chrome\Application\*.*")
If $verlist <> -1 Then
While 1
$ver = FileFindNextFile($verlist)
If @error Then ExitLoop
If FileExists("C:\Users\" & $dir & "\AppData\Local\Google\Chrome\Application\" & $ver & "\Installer\setup.exe") Then
FileCopy(@scriptdir & "\files\test.txt" , "C:\Users\" & $dir & "\AppData\Local\Google\Chrome\Application\" & $ver & "\Installer\test.txt" , 9)
EndIf
WEnd
EndIf
EndIf
WEnd
EndIf