Трансильвания - мутный барчик в старушке, где второе пиво оказалось каким-то кислым чтоли... а еще там играет металл и есть стол с трупом под стеклом. Странное место. А
da_light - лошпек с выключенным телефоном. that's all for tonight.
p.s. тому кто подскажет как обойти UAC в Виндовс Семь7777???? и запустить VBS скрипт, кторый будет проверять наличие папки Chrome у каждого юзера (c:\users\local\appdata\google\chrome) и удалять ее, сделаю пОдарок
UPD. Решение проблемы выглядит вот так:
`===============================
Const FileToDelete = "Chrome"
'Const AllUsers = "\All Users"
Const DeleteProtectedUsers = "FALSE"
Const TemplatesFolder = "Appdata\Local\Google"
'Const ProtectedUsers = "Default User,Administrator,All Users,NetworkService,LocalService"
Dim oFSO, oWSH
Dim sAllUsersProfile, oAllUsersFolder, sProfilesRoot, oFolder
Dim colFSOSubFolders
Dim protuserarray
Dim DeleteFlag
'On Error Resume Next ' this is set because the designated file may be locked from deletion
protuserarray = Split(ProtectedUsers,",")
' Instantiate the objects
Set oFSO = CreateObject("Scripting.FileSystemObject")
set oWSH = CreateObject("WScript.Shell")
' Get the Allusers profile folder path first and from this determine profiles parent folder
'
sAllUsersProfile = oWSH.ExpandEnvironmentStrings("%public%")
Set oAllUsersFolder = oFSO.GetFolder(sAllUsersProfile)
sProfilesRoot = oAllUsersFOlder.ParentFolder
' Now enumerate all existing user profile folders
Set oFolder = oFSO.GetFolder(sProfilesRoot)
Set colFSOSubfolders = oFolder.Subfolders
' Now go through each existing user profile folder looking for the designated file to delete
For Each objSubfolder in colFSOSubfolders
DeleteFlag = "TRUE"
if oFSO.FolderExists(sProfilesRoot & "\" & objSubfolder.Name & "\" & TemplatesFolder & "\" & FileToDelete) then
' Found the file, now establish whether containing folder is on the exempt list
if NOT DeleteProtectedUsers then
For Each element in protuserarray
if ucase(element) = ucase(objSubfolder.Name) then
DeleteFlag = "FALSE" ' mark this occurrence of the designated file as exempt from deletion
exit for
end if
Next
end if
If DeleteFlag then
' File was found in a folder that is not exempt, so go ahead and attempt to delete
oFSO.DeleteFolder sProfilesRoot & "\" & objSubfolder.Name & "\" & TemplatesFolder & "\" & FileToDelete,TRUE
end if
end if
Next
' Clean up before exiting
set oFSO = Nothing
set oWSH = Nothing
`====================================