Howdy, essaie de copier un fichier du cache IE vers un autre emplacement. Cela fonctionne sur W7, mais pas Vista Ultimate.La copie de PowerShell échoue sans avertissement
En bref:
copie article $ f -Destination "$ targetDir" -force
(j'ai aussi essayé f.fullname $)
Le script complet:
$targetDir = "C:\temp"
$ieCache=(get-itemproperty "hkcu:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders").cache
$minSize = 5mb
Write-Host "minSize:" $minSize
Add-Content -Encoding Unicode -Path $targetDir"\log.txt" -Value (get-Date)
Set-Location $ieCache
#\Low\Content.IE5 for protected mode
#\content.ie5 for unprotected
$a = Get-Location
foreach ($f in
(get-childitem -Recurse -Force -Exclude *.dat, *.tmp | where {$_.length -gt $minSize})
)
{
Write-Host (get-Date) $f.Name $f.length
Add-Content -Encoding Unicode -Path $targetDir"\log.txt" -Value $f.name, $f.length
copy-item $f -Destination "$targetDir" -force
}
Fin de la sagesse. S'il vous plaît aider!