Skip to content

Instantly share code, notes, and snippets.

@feiss
Last active June 13, 2016 09:11
Show Gist options
  • Save feiss/fdbc59227c794fb80d2db0ceadcffdbe to your computer and use it in GitHub Desktop.
Save feiss/fdbc59227c794fb80d2db0ceadcffdbe to your computer and use it in GitHub Desktop.
CDD in Powershell
# usage:
# save this gist in a file call cdd.sh1
# then, add a shortcut in the desktop or taskbar with the target:
# C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "& <full path to cdd.ps1>"
#
# When executed, type the folder name where you want to jump. Write "scan" if you want to refresh folder cache
$folder = Read-Host ' '
if ($folder -eq 'scan'){
echo '' > $Home\folders.txt
ls -R -Direc C:\ | foreach { echo $_.FullName} >> $Home\folders.txt
#add more drives like line above, in the priority order you desire
Exit
}
$paths= Get-Content $Home\folders.txt | Select-String $folder
start $paths[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment