Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

Desktop Organizer - Reloaded 2016

[Image: 9Zlkno4.png]


Hello. I was goofing around a week or two ago, and never got a chance to post this, but I feel like I should. A little over a year ago, I made a Desktop Organizer. Looking back on the code, it was very pitiful. But now, my batch skills have gotten better, and I decided to make a reloaded version. This time it is way more efficient, and uses a significant less amount of lines than the first one did. The original project can be found here 😖
Code
@echo off >Nul
Set "droppath=%userprofile%\Desktop"
For %%a In (.txt, .png, .mp3, .docx, .bat) Do (For %%b In (%%a) Do (
      If exist "%droppath%\*%%a" Mkdir %%a
      Move "%droppath%\*%%b" %path%\%%a
  )
)
pause >nul
@exit /B
As you can see, the %path% variable is set to the desktop. This can be changed to organize any folder you'd like. I probably should have changed the name to "folder organizer" but by default, it is set to organize the most used part of your machine. Feel free to add to this code or do whatever.
Nice thread man!
Although I keep my Desktop organized and probably won't find this useful, I see this being helpful for many other users.
UKninja message meeee
Thanks for this, will come handy as i have a desktop which makes me fucking dizzy.
Nice share man 🤝
Thank you guys for your feedback 🤝 Lmk if there is anything I should add.
(Jul 31, 2016 05:01 AM)Ventriloquism Wrote:  Hello. I was goofing around a week or two ago, and never got a chance to post this, but I feel like I should. A little over a year ago, I made a Desktop Organizer. Looking back on the code, it was very pitiful. But now, my batch skills have gotten better, and I decided to make a reloaded version. This time it is way more efficient, and uses a significant less amount of lines than the first one did. The original project can be found here 😖
Code
@echo off >Nul
Set "path=%userprofile%\Desktop"
For %%a In (.txt, .png, .mp3, docx, .bat) Do (For %%b In (%%a) Do (
      If exist "%path%\*%%a" Mkdir %%a
      Move "%path%\*%%b" %path%\%%a
  )
)
pause >nul
@exit /B
As you can see, the %path% variable is set to the desktop. This can be changed to organize any folder you'd like. I probably should have changed the name to "folder organizer" but by default, it is set to organize the most used part of your machine. Feel free to add to this code or do whatever.

i like the idea i like the syntax, good job

one thing though, just because of what the environment variable "path" is and how significant that is and bad it would be if it got globally changed not just changed within this batch-file's running session it even though it wont be it might be better to use
Code
cd  /d "%userprofile%\desktop"
than
Code
Set "path=%userprofile%\Desktop"
just out of good habit




good job,
this would definitely simplify my desktop lol
(Jul 31, 2016 06:43 PM)ImDeepWithWindows Wrote:  just out of good habit

I'm not sure what you are trying to tell me. Are you saying if the current disk were to change or something?

Sorry, I'm incredibly exhausted 🤮
Hi, may I use this amazing little script in one of my scripts? I will give you credit of course!
(Jul 31, 2016 06:43 PM)ImDeepWithWindows Wrote:  i like the idea i like the syntax, good job

one thing though, just because of what the environment variable "path" is and how significant that is and bad it would be if it got globally changed not just changed within this batch-file's running session it even though it wont be it might be better to use
Code
cd  /d "%userprofile%\desktop"
than
Code
Set "path=%userprofile%\Desktop"
just out of good habit




good job,
this would definitely simplify my desktop lol

(Jul 31, 2016 06:50 PM)Ventriloquism Wrote:  I'm not sure what you are trying to tell me. Are you saying if the current disk were to change or something?

Sorry, I'm incredibly exhausted 🤮

What he means is that %PATH% is a globally default variable already. Open CMD and type echo %path%.

It would be wise to NOT overwrite preexisting default variables.
I spy a potential issue, you forgot to put '.docx' meaning if a file was docx.exe it would still be sorted with the .docx files... Please correct me if I'm wrong..

Thanks for the share OP!
(Aug 31, 2016 01:32 PM)๖ۣۜOpulence Wrote:  I spy a potential issue, you forgot to put '.docx' meaning if a file was docx.exe it would still be sorted with the .docx files... Please correct me if I'm wrong..

Thanks for the share OP!

No, you're right lol. I forgot the period at the beginning. I'll fix it 😝

@Icarus I didn't know that. I'll change that was well.
Awesome! This is definitely something I am going to try out :D
Keep up the good work.
My BTC addy: 1Q2TJWXzVwcLMsEQmPVgwESJPdv4AEZNgE


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by fisica638Sep 3, 2020 01:44 PM 6 223 Sep 3, 2020 01:44 PM
Last Post: IGK4L
[C] by Dark SpiderJun 28, 2019 06:59 AM 2 622 Jun 28, 2019 06:59 AM
Last Post: Darkmen666
[C#] by uyen200770Mar 15, 2018 02:06 PM 7 203 Mar 15, 2018 02:06 PM
Last Post: Ninja