Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vyach-vasiliev/2eb1eb6a012165a18f1a31e0af2a78d9 to your computer and use it in GitHub Desktop.
Save vyach-vasiliev/2eb1eb6a012165a18f1a31e0af2a78d9 to your computer and use it in GitHub Desktop.
Ignore from Dropbox by context menu in Windows OS [updated 2024]

💯 Ignore from Dropbox 2024

The fastest and easiest way to exclude a folder or file from synchronization with Dropbox for Windows OS. You can also recursively exclude all node_modules folders in all subfolders.

Preview in context menu

image

How to ignore file/folder from Dropbox

  • Right-click on the file or folder.
  • Select "Ignore from Dropbox" from the context menu.
  • Ready. After some time, the Dropbox application will stop synchronizing the selected file or folder.

How to ignore node_modules from all subfolders

  • Right-click on the file or folder.
  • Select "Ignore node_modules from Dropbox" from the context menu.
  • Bingo! After some time, the Dropbox app will stop syncing all node_modules folders inside the selected folder.

How to install?

  • Download the archive with files in the upper right corner of the page.
  • Unzip and double-click the Install_Ignore_From_Dropbox_Context_Menu.reg file.
  • There are now two custom menu items in your context menu (as in the screenshot above).

To delete, double-click the Uninstall_Ignore_From_Dropbox_Context_Menu.reg file. Now the two custom menu items you added earlier have disappeared from your context menu.

The menu items of Dropbox itself are not edited/updated/deleted in any way.

How it works?

  • First the script finds the node_modules folder
  • then marks the stream parameter com.dropbox.ignored as 1
  • then moves on to the next node_modules folder found

In some cases, all the files in the node_modules folder can be already indexed by Dropbox. And marking only the node_modules folder will not allow you to cancel the current active synchronization of these files.

In this case, you must marking this stream parameter com.dropbox.ignored to all nested files and folders. It can take some time.

Examples of manual control via powershell console:

# print all node_modules paths
Get-ChildItem -Path "./" -Filter "node_modules" -Directory -Recurse | Where-Object { $_.FullName -notlike '*\node_modules\*' } | ForEach-Object { Write-Host $_.FullName }

# set ingoring only top node_modules paths (excluding nested node_modules)
Get-ChildItem -Path "./" -Filter "node_modules" -Directory -Recurse | Where-Object { $_.FullName -notlike '*\node_modules\*' } | ForEach-Object { Set-Content -Path $_.FullName -Stream com.dropbox.ignored -Value 1 ; Write-Host (Get-Content -Path $_.FullName -Stream com.dropbox.ignored) $_.FullName }

# print all files and folders in node_modules paths
Get-ChildItem -Path "./" -Filter "node_modules" -Directory -Recurse | ForEach-Object { Get-ChildItem -Path $_.FullName | ForEach-Object { Write-Host $_.FullName} }

# set ingoring all files and folders in node_modules paths (including nested node_modules)
Get-ChildItem -Path "./" -Filter "node_modules" -Directory -Recurse | ForEach-Object { Get-ChildItem -Path $_.FullName | ForEach-Object { Set-Content -Path $_.FullName -Stream com.dropbox.ignored -Value 1 ; Write-Host $_.FullName} }
Windows Registry Editor Version 5.00
;= Setup ignore file/folder menu.
;= Context menu to folders:
[HKEY_CLASSES_ROOT\Directory\shell\Dropbox F Ignore]
"AppliesTo"="System.ItemPathDisplay:\"Dropbox\""
"Icon"="C:\\Program Files (x86)\\Dropbox\\Client\\Dropbox.exe,12"
@="Ignore from Dropbox"
[HKEY_CLASSES_ROOT\Directory\shell\Dropbox F Ignore\command]
@="cmd.exe /s /c \"powershell -command \"Set-Content -Path \"%1\" -Stream com.dropbox.ignored -Value 1\"\""
;= Context menu to files:
[HKEY_CLASSES_ROOT\*\shell\Dropbox F Ignore]
"AppliesTo"="System.ItemPathDisplay:\"Dropbox\""
"Icon"="C:\\Program Files (x86)\\Dropbox\\Client\\Dropbox.exe,12"
@="Ignore from Dropbox"
[HKEY_CLASSES_ROOT\*\shell\Dropbox F Ignore\command]
@="cmd.exe /s /c \"powershell -command \"Set-Content -Path \"%1\" -Stream com.dropbox.ignored -Value 1\"\""
;= Setup ignore node_modules menu.
;= Context menu to folders:
[HKEY_CLASSES_ROOT\Directory\shell\Dropbox NM Ignore]
"AppliesTo"="System.ItemPathDisplay:\"Dropbox\""
"Icon"="C:\\Program Files (x86)\\Dropbox\\Client\\Dropbox.exe,12"
@="Ignore node_modules from Dropbox"
[HKEY_CLASSES_ROOT\Directory\shell\Dropbox NM Ignore\command]
@="cmd.exe /s /c \"powershell -command \"Get-ChildItem -Path \"%1\" -Filter \"node_modules\" -Directory -Recurse | Where-Object { $_.FullName -notlike '*\\node_modules\\*' } | ForEach-Object { Set-Content -Path $_.FullName -Stream com.dropbox.ignored -Value 1 ; Write-Host (Get-Content -Path $_.FullName -Stream com.dropbox.ignored) $_.FullName}\" & pause\""
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\Dropbox F Ignore]
[-HKEY_CLASSES_ROOT\Directory\shell\Dropbox F Ignore]
[-HKEY_CLASSES_ROOT\Directory\shell\Dropbox NM Ignore]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment