Application that will move file to new folder with file's name

0

1

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

icl7126

Posted 2013-01-14T17:19:05.557

Reputation: 401

Answers

3

  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

nixda

Posted 2013-01-14T17:19:05.557

Reputation: 23 233

I like your improvisation :) but there is one bug. It won't move file if path contains spaces. Can you help me with that? – icl7126 – 2013-01-14T19:30:30.510

Oh, its fixed now. – nixda – 2013-01-14T19:54:50.557