Erro: Não foi possivel acessar o caminho do arquivo na pasta do OneDrive.

Anônima
2019-12-01T18:56:42+00:00

Olá. Ultimamente tem ocorrido muito o erro "Erro: Não foi possivel acessar..." (caminho do arquivo na pasta do onedrive). E sempre que acontece tenho que reconectar e o onedrive precisa atualizar todos os arquivos de novo. Alguma dica de como resolver? 

Windows para casa | Windows 10 | Arquivos, pastas e armazenamento

Pergunta bloqueada. Essa pergunta foi migrada da Comunidade de Suporte da Microsoft. É possível votar se é útil, mas não é possível adicionar comentários ou respostas ou seguir a pergunta.

0 comentários Sem comentários
Resposta aceita pelo autor da pergunta
Anônima
2019-12-04T21:00:53+00:00

Olá Braulio, tudo bem?

Obrigado pelo retorno, será necessário seguir métodos mais avançados para desinstalar o OneDrive utilizando o PowerShell.

Não execute caso não se sinta confortável com o PowerShell do Windows 10.

Caso as linhas de código não fiquem claras, peço que verifique esta thread:

Aperte as teclas Windows + Q e procure por PowerShellclique com o botão direito e depois em Executar como administrador.

Copie e cole toda a linha de código abaixo para eliminar o OneDrive e seus vestígios.

Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1

echo "73 OneDrive process and explorer"
taskkill.exe /F /IM "OneDrive.exe"
taskkill.exe /F /IM "explorer.exe"

echo "Remove OneDrive"
if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") {
    & "$env:systemroot\System32\OneDriveSetup.exe" /uninstall
}
if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") {
    & "$env:systemroot\SysWOW64\OneDriveSetup.exe" /uninstall
}

echo "Disable OneDrive via Group Policies"
force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive"
sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1

echo "Removing OneDrive leftovers trash"
rm -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive"
rm -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive"
rm -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp"

echo "Remove Onedrive from explorer sidebar"
New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR"
mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
sp "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0
mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
sp "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0
Remove-PSDrive "HKCR"

echo "Removing run option for new users"
reg load "hku\Default" "C:\Users\Default\NTUSER.DAT"
reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f
reg unload "hku\Default"

echo "Removing startmenu junk entry"
rm -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk"

echo "Restarting explorer..."
start "explorer.exe"

echo "Wait for EX reload.."
sleep 15

echo "Removing additional OneDrive leftovers"
foreach ($item in (ls "$env:WinDir\WinSxS\*onedrive*")) {
    Takeown-Folder $item.FullName
    rm -Recurse -Force $item.FullName
}

Após terminar o primeiro script execute a seguinte função para forçar a criação da pasta.

function force-mkdir($path) {
if (!(Test-Path $path)) {
    #Write-Host "-- Creating full path to: " $path -ForegroundColor White -BackgroundColor DarkGreen
    New-Item -ItemType Directory -Force -Path $path
}}

E por ultimo assimilar propriedade do registro.

function Takeown-Registry($key) { # TODO does not work for all root keys yet switch ($key.split('')[0]) { "HKEY_CLASSES_ROOT" { $reg = [Microsoft.Win32.Registry]::ClassesRoot $key = $key.substring(18) } "HKEY_CURRENT_USER" { $reg = [Microsoft.Win32.Registry]::CurrentUser $key = $key.substring(18) } "HKEY_LOCAL_MACHINE" { $reg = [Microsoft.Win32.Registry]::LocalMachine $key = $key.substring(19) } }

    # get administraor group
    $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544")
    $admins = $admins.Translate([System.Security.Principal.NTAccount])

    # set owner
    $key = $reg.OpenSubKey($key, "ReadWriteSubTree", "TakeOwnership")
    $acl = $key.GetAccessControl()
    $acl.SetOwner($admins)
    $key.SetAccessControl($acl)

    # set FullControl
    $acl = $key.GetAccessControl()
    $rule = New-Object System.Security.AccessControl.RegistryAccessRule($admins, "FullControl", "Allow")
    $acl.SetAccessRule($rule)
    $key.SetAccessControl($acl)
}

function Takeown-File($path) {
    takeown.exe /A /F $path
    $acl = Get-Acl $path

    # get administraor group
    $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544")
    $admins = $admins.Translate([System.Security.Principal.NTAccount])

    # add NT Authority\SYSTEM
    $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admins, "FullControl", "None", "None", "Allow")
    $acl.AddAccessRule($rule)

    Set-Acl -Path $path -AclObject $acl
}

function Takeown-Folder($path) {
    Takeown-File $path
    foreach ($item in Get-ChildItem $path) {
        if (Test-Path $item -PathType Container) {
            Takeown-Folder $item.FullName
        } else {
            Takeown-File $item.FullName
        }
    }
}

function Elevate-Privileges {
    param($Privilege)
    $Definition = @"
    using System;
    using System.Runtime.InteropServices;
    public class AdjPriv {
        [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
            internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr rele);
        [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
            internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok);
        [DllImport("advapi32.dll", SetLastError = true)]
            internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid);
        [StructLayout(LayoutKind.Sequential, Pack = 1)]
            internal struct TokPriv1Luid {
                public int Count;
                public long Luid;
                public int Attr;
            }
        internal const int SE_PRIVILEGE_ENABLED = 0x00000002;
        internal const int TOKEN_QUERY = 0x00000008;
        internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
        public static bool EnablePrivilege(long processHandle, string privilege) {
            bool retVal;
            TokPriv1Luid tp;
            IntPtr hproc = new IntPtr(processHandle);
            IntPtr htok = IntPtr.Zero;
            retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
            tp.Count = 1;
            tp.Luid = 0;
            tp.Attr = SE_PRIVILEGE_ENABLED;
            retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid);
            retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);
            return retVal;
        }
    }
"@
    $ProcessHandle = (Get-Process -id $pid).Handle
    $type = Add-Type $definition -PassThru
    $type[0]::EnablePrivilege($processHandle, $Privilege)
}

Dica: Caso perceba que o comando não está em andamento (pausado), aperte enter para retomar.

Após os comandos, reinicie o computador e tente instalar o OneDrive novamente.

Espero seu retorno.

Esta resposta foi útil?

2 pessoas acharam esta resposta útil.
0 comentários Sem comentários

24 respostas adicionais

Classificar por: Mais útil
  1. Anônima
    2019-12-02T20:43:48+00:00

    Ao mandar executar "%localappdata%\Microsoft\OneDrive\onedrive.exe /reset" aparece mensagem de erro dizendo que não foi possível localizar. Mandei desisntalar o onedrive pelo painel de controle, mas não desinstala. Mandei desisntalar pela janela "Aplicativos e recursos" e não desisntala. Ao clicar em Iniciar e digitar onedrive não mostra o aplicativo. Tentei reinstalar o Office e o Onedrive não instala ou reinstala. Estou sem o programa.

    Ao clicar no link do onedrive na janela do office abre o site do onedrive. Clico em obter aplicativos e em "Iniciar o onedrive". Aparece isso:

    Esta resposta foi útil?

    0 comentários Sem comentários
  2. Anônima
    2019-12-02T14:26:55+00:00

    Olá. Tentei os procedimentos, mas aparece mensagem dizendo que não foi possível localizar.

    Esta resposta foi útil?

    0 comentários Sem comentários
  3. Anônima
    2019-12-02T14:18:56+00:00

    Olá. Verifiquei o arquivo existe no local indicado.

    Esta resposta foi útil?

    0 comentários Sem comentários
  4. Anônima
    2019-12-02T07:13:50+00:00

    Este artigo pode ajudá-lo a encontrar a solução :

    https://support.office.com/fr-fr/article/erreur...

    Esta resposta foi útil?

    0 comentários Sem comentários