Skip to content

Instantly share code, notes, and snippets.

@movahhedi
Created April 26, 2025 18:41
Show Gist options
  • Save movahhedi/d44783b8fc34a011214e7d760a10bf21 to your computer and use it in GitHub Desktop.
Save movahhedi/d44783b8fc34a011214e7d760a10bf21 to your computer and use it in GitHub Desktop.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\DupFolderWithoutNodeModules]
@="Duplicate folder without node_modules"
[HKEY_CLASSES_ROOT\Directory\shell\DupFolderWithoutNodeModules\command]
@="C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -File \"G:\\System Related\\DuplicateFolderWithoutNode_Modules.ps1\" \"%L\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\DupFolderWithoutNodeModulesGit]
@="Duplicate folder without node_modules & .git"
[HKEY_CLASSES_ROOT\Directory\shell\DupFolderWithoutNodeModulesGit\command]
@="C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -File \"G:\\System Related\\DuplicateFolderWithoutNode_ModulesGit.ps1\" \"%L\""
$Source = $args[0]
$Position = $Source.lastindexofany("\")
$Destination = $Source.substring(0, $Position + 1)
$FolderName = $Source.substring($Position + 1)
$Destination = "$($Destination)$($FolderName)-DUPLICATE_WITHOUT_NODE_MODULES"
robocopy $Source $Destination /mir /xd node_modules
$Source = $args[0]
$Position = $Source.lastindexofany("\")
$Destination = $Source.substring(0, $Position + 1)
$FolderName = $Source.substring($Position + 1)
$Destination = "$($Destination)$($FolderName)-DUPLICATE_WITHOUT_NODE_MODULES_GIT"
robocopy $Source $Destination /mir /xd node_modules /xd ".git"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment