Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any application or .reg file that will add new item to Windows Context menu to all files that will have this functionality:
1. create new folder with name of selected file
2. move selected file to this folder

share|improve this question

1 Answer 1

up vote 2 down vote accepted
  1. press Win + R and type in shell:sendto
  2. create a new textfile in this folder and copy & paste the following lines
    @echo off
    cd /D "%~dp1"
    md "%~n1"
    move %1 "%~dp1%~n1"
  3. save it as folder.cmd (or whatever you wish as long as the extension is .cmd or .bat)

Explanation

  • %1 » The normal parameter that represents your selected file
  • cd » Change Directory - move to a specific Folder
  • %~dp1 » Extracts the drive & path from %1
  • md » Make Directory - Creates a new folder
  • %~n1 » Extracts the filename from %1 without the extension
  • move » Move a file from one folder to another

Source: batch parameters & batch commands

share|improve this answer
    
I like your improvisation :) but there is one bug. It won't move file if path contains spaces. Can you help me with that? –  klerik Jan 14 '13 at 19:30
    
Oh, its fixed now. –  nixda Jan 14 '13 at 19:54
    
You are the best! thanks –  klerik Jan 14 '13 at 20:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.