Files moved to trash and now missing from Desktop

Recently, we have a run in with a lot of our files turning into .cloudf formatting. After syncing our files again, we noticed that a lot of our files were brought back to their original formatting. However, when syncing, it didn’t look like we pulled our company files that have a prefix ‘~’.

Looking at our trashbin, a lot of the folders we synced back DID have files in them but they’re not showing in the desktop folders.

Any ideas on what we should do? We don’t want to just randomly restore all the files that were moved to trash in the case that there’s more loss of information from conflicts.

Hi @rohit,
Apologies for the confusion.

odrive ignores files that have a leading ‘~’ character because they are almost exclusively temp files. Here is a full list of ignored patterns:

No problem.

We actually have quite a few files with a leading ‘~’ that we need pulled. A lot of our PDFs are missing as they have the ‘~’. We have synced up the files and downloaded them back after having our folders turn into .cloudf files but we’re missing any PDF’s/files that have the prefix.

Any ideas on what to do here?

Hi @rohit,
You mentioned that you have these files in your trash still? Is that correct? Which trash bin are you talking about?

By the way, was this Amazon Drive? I just wanted to make sure you saw this post about that particular problem they had that caused this: Sudden Disappearance of all Amazon Drive Files - 2017 - 01 - 23 - * RESOLVED *

The files are showing up in my desktops recycle bin.

Looking at the link you just sent, it does look like this may have been closely related because a lot of files were randomly sent to trash on the 23rd.

I was following the comments but wasn’t sure what the resolution was.

What should I be doing to get my files back?

**Some additional information: Since this issue came up, we have still used some of the files that were still there and are concerned that there may be conflicts that arise if we were to simply ‘Restore’ all the files deleted on the 23rd. What’s the best suggestion here?

Hi @rohit,
All files that didn’t fall into the ignored pattern (hopefully just files beginning with ~ ) should already be in the cloud and shouldn’t need to be restored from trash. Any files that did begin with a ~ wouldn’t have been synced in the first place, so you should restore those and remove the leading ~ so they can sync up.

I’m not sure if this covers the issue entirely, so let me know if you have any questions.

There’s just the issue with restoring the files. A lot of the removed files were inside the folders as well.

You can see below that a lot of the deleted files are actually folders. The files that need to be restored are inside the subfolders/subsubfolders. This would be QUITE a bit of files to restore and the main folders would most likely cause conflicts as they’re already back and synced properly.

Is manually restoring the only option here???

the directories would look like …/mainA/folder1/~file.pdf

Hi @rohit,
Hmm… yes I see the problem here.

What we could do is drag those items to temporary location (instead of restoring just drag and drop the folders to a folder of your choosing).

Once we have the data in a “normal” folder, we can probably script up something, although I would need to look into that a little more. What I am thinking is that we copy only files with a leading ~ and then replace the ~ with another character after the copy.

That honestly sounds good. If you could please let me know how we could do this, I’d be glad to give it a shot!

I’m in the dark here and it’s causing quite some issues already.


Any updates on this? These files are not small and are very very tedious to go into and check if there’s a conflict and then put it back in.

Hoping we can figure out a solution here.

Thank you!

Hi @rohit,
I have a script that should work. Here are the steps you will need to take:

  1. Restore the trashed folders to a temporary location by dragging and dropping them from the Recycle bin into the folder you’ve chosen. For example, drag and drop the folders listed in your screenshot above into C:\Users\Administrator\Desktop\Recover\Company Data\Attach which should mimic where the files were, minus the C:\Users\Administrator\Desktop\Recover part.
    Try this with just one folder, initially, to make sure you understand the whole process.

  2. Run the following script, which will copy all of the files starting with a ~ character from that folder into the original folder:

powershell -command " & {$source_folder = \"C:\Users\Administrator\Desktop\Recover\"; $destination_folder = \"C:\"; Get-ChildItem -Path \"$source_folder\" -Filter \"~*\" -Recurse | % { $source_file = $_.FullName; $destination_file = $source_file.Replace(\"$source_folder\",\"$destination_folder\").Replace(\"~\",\"-\"); new-item -Force \"$destination_file\"; copy -Path \"$source_file\" -Destination \"$destination_file\" -Recurse -Force;};}"

What this will do is search the source_folder (C:\Users\Administrator\Desktop\Recover) for any files starting with a ‘~’. It will then copy those files into destination_folder (C:), keeping the path elements after source_folder (Company Data\Attach) and replacing the ‘~’ with a ‘-’.

For example, C:\Users\Administrator\Desktop\Recover\Company Data\Attach\Folder1\~file1.txt would be copied to C:\Company Data\Attach\Folder1\-file1.txt

To run the command above, do the following:

You can open up a command prompt by clicking on the Windows icon in the taskbar, typing “cmd”, and then clicking on “Command Prompt”.

Once the command prompt is open, copy and paste the command above in (all one line) and hit enter.

You will need to adjust the $source_folder and $destination_folder values if they are going to differ from my example.

Please let me know if you have any questions.

Hi Tony,

Thanks for the response. Looking at the script I think I get what we need to do here.

My concern is that with renaming the files, we’ll no longer be able to access them via QuickBooks. In order to view the file from QuickBooks, it searches up the exact location & filename and checks if its there; if it is, we can open it via QuickBooks as that was where we had previously stored it and it’s saved in QuickBooks.

Would it be possible to do this without the replace of the ~?

I’ll be giving it a try momentarily with one folder.

Hi @rohit,
Currently there isn’t a way to sync file with a leading ~ via the odrive desktop client.

Hmmm, does this mean that if we were to move all the files back to their original location, they’d slowly get removed again as well?

Or would there only really be an issue if our files were to turn into .cloudf/.cloud files again and we tried to sync again?

Hi @rohit,
The files will stay there unless the folder containing them disappears on the remote side, which is what happened when Amazon Drive was returning nothing during their incident. If the files have a leading ‘~’ they will not sync, however, so they will not be backed up to the cloud.

Thanks for the info!

I tried running the script and ran into some issues and wasn’t too clear on what to do.

Ran into the below error message.

Untitled 3

Here’s the command I ran as well.

powershell -command " & {$source_folder = “C:\Users\Administrator\Desktop\Recover\Company Data\Attach{Company Name}\Txn”; $destination_folder = “C:”; Get-ChildItem -Path “$source_folder” -Filter “~*” -Recurse | % { $source_file = $_.FullName; $destination_file = $source_file.Replace("$source_folder","$destination_folder"); new-item -Force “$destination_file”; copy -Path “$source_file” -Destination “$destination_file” -Recurse -Force;};}"

With {company name} actually being one of the folder names.

I’m currently looking into additional information as well but hoping this works soon!

Hi @rohit,
It looks like some of the characters may have been changed on the copy. This can sometimes happen if the command is copied into an editor that likes to fancy-up the quotes, for example. You can see some of the quotation marks are typographical instead of neutral, where they are curved and reversed on opposite sides.

To prevent this from happening, grab a free program called notepad++. It is my go-to basic text editor and will keep the text you paste in the same.

powershell -command " & {$source_folder = \"C:\Users\Administrator\Desktop\Recover\Company Data\Attach\{Company Name}\Txn\"; $destination_folder = \"C:\temp\"; Get-ChildItem -Path \"$source_folder\" -Filter \"~*\" -Recurse | % { $source_file = $_.FullName; $destination_file = $source_file.Replace(\"$source_folder\",\"$destination_folder\").Replace(\"~\",\"-\"); new-item -Force \"$destination_file\"; copy -Path \"$source_file\" -Destination \"$destination_file\" -Recurse -Force;};}"

I have a feeling your pathing will need to be adjusted, but since this is just a test on a single folder, let’s see how it goes. I changed the destination to C:\temp in the above command too, so make sure that folder exists. I just wanted to make it a pure test case so you can see the behavior.

Hi @Tony,

I was able to pull some directories/files but it would ask me to enter a ‘type’ for every file and would pull each directory/file individually.

So I would enter the following:
powershell -command " & {$source_folder = “C:\Users\Administrator\Desktop\Recover\Company Data\Attach{Company Name}\Txn”; $destination_folder = “C:\temp”; Get-ChildItem -Path “$source_folder” -Filter “~*” -Recurse | % { $source_file = $_.FullName; $destination_file = $source_file.Replace("$source_folder","$destination_folder").Replace("~","-"); new-item -Force “$destination_file”; copy -Path “$source_file” -Destination “$destination_file” -Recurse -Force;};}"

From there, it would ask for a ‘Type’ of which I would enter ‘directory’ or ‘file’. Once I hit enter, it would ask me the same thing and I’d have to enter ‘directory’ or ‘file’. When looking at the folder, it seems to be adding them one by one. Is there a command such that it just pulls the file without having to type ‘file’ each time? I was under the impression this was recursive.

Thank you again!

Hi @rohit,
Try this command. I think the new-item command may not default to file on some versions of powershell:

powershell -command " & {$source_folder = \"C:\Users\Administrator\Desktop\Recover\Company Data\Attach\{Company Name}\Txn\"; $destination_folder = \"C:\temp\"; Get-ChildItem -Path \"$source_folder\" -Filter \"~*\" -Recurse | % { $source_file = $_.FullName; $destination_file = $source_file.Replace(\"$source_folder\",\"$destination_folder\").Replace(\"~\",\"-\"); new-item -Path \"$destination_file\" -ItemType "file" -Force; copy -Path \"$source_file\" -Destination \"$destination_file\" -Recurse -Force;};}"

1 Like