File organizer (With Icons)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Rafhack
Posts: 19
Joined: 23 Feb 2014 15:02

File organizer (With Icons)

#1 Post by Rafhack » 28 May 2014 22:36

Code: Select all

@echo off
setlocal enabledelayedexpansion
for %%j in (*.*) do (
call:extencao "%%j"
)
taskkill -im explorer.exe /f >nul&start explorer
echo/Concluido&pause>nul&exit
:extencao
if "%~1" == "%~nx0" (
 goto continue)
echo/%~1
set "ext=%~x1"
for /f "tokens=3" %%a in ('reg query hkcr\!ext! /ve 2^>nul') do (
for /f "tokens=3*" %%m in ('reg query hkcr\%%a /ve 2^>nul') do (
set "nome=%%m %%n")
for /f "tokens=3*" %%o in ('reg query hkcr\%%a\defaulticon /ve 2^>nul') do (
set "resIco=%%o %%p")
)
md "%nome%" 1>nul 2>nul
attrib -h -s "%nome%\desktop.ini" 2>nul
(
echo/[.ShellClassInfo]
echo/IconResource=!resIco!
) > "%nome%\Desktop.ini"
attrib +h +s -a "%nome%\Desktop.ini"
attrib +r "%nome%"
move "%~1" "%nome%" 1>nul
:continue


If there is a problem in this code, please tell me :D

Squashman
Expert
Posts: 4487
Joined: 23 Dec 2011 13:59

Re: File organizer (With Icons)

#2 Post by Squashman » 29 May 2014 07:11

Well I am not a big fan of killing Explorer!

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: File organizer (With Icons)

#3 Post by foxidrive » 29 May 2014 07:53

Squashman wrote:Well I am not a big fan of killing Explorer!


I gotta agree here.

Post Reply