![]() |
|
[Shell] Desktop Organizer - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Shell] Desktop Organizer (/showthread.php?tid=5106224) |
Desktop Organizer - wurd - Dec 23, 2015 Short but sweet code, drag and drop a mess of programs and the code organizes the programs by their extensions. Code @echo off & setlocal EnableDelayedExpansion* - White Light - Dec 23, 2015 Just taking a quick glance through it, I've got a small suggestion. You should take a look at using a standard FOR loop (no extra switches) to loop over %* It has all the arguments already, so you don't need to shift for each one. * - wurd - Dec 23, 2015 (Dec 23, 2015 10:44 PM)White Light Wrote: Just taking a quick glance through it, I've got a small suggestion. You should take a look at using a standard FOR loop (no extra switches) to loop over %* It has all the arguments already, so you don't need to shift for each one.I'll look into it in the morning, way too tired to function right now I've been trying to use the standard for loop but I keep getting errors when I try to loop through the extensions Code for %%A in (%~x*) do set /a "y+=1" & set "progext!x!=%%A"Code for %%A in (%*) do set /a "x+=1" & set "prog!x!=%%A"* - 0xDEAD10CC - Dec 25, 2015 As far as I can tell, you need to loop through %*, not %~x*, and from there you would do %%~xA... Ex: Code FOR %%G IN (%*) DO (* - White Light - Dec 25, 2015 (Dec 23, 2015 11:00 PM)wurd Wrote: I'll look into it in the morning, way too tired to function right now As 0xDEAD10CC said, you should loop through %* and then use the x modifier on each individual result. There's no way for the script to natively use modifiers on %* without first parsing through the individual parameters. * - wurd - Dec 28, 2015 Fixed. Thanks for the help guys * - Stamina_Client - Jan 2, 2016 I'm new to coding can you tell me exactly what this is suppost to do? i ran it and it said applications cleaned so i guess it work -stamina * - Nakamoto. - Jan 2, 2016 (Jan 2, 2016 12:58 PM)Stamina_Client Wrote: I'm new to coding can you tell me exactly what this is suppost to do? i ran it and it said applications cleaned so i guess it work it organizes them by filetype, so all like filetypes are grouped up. * - wurd - Jan 4, 2016 (Jan 2, 2016 12:58 PM)Stamina_Client Wrote: I'm new to coding can you tell me exactly what this is suppost to do? i ran it and it said applications cleaned so i guess it workClick and drag the programs you want to be cleaned onto the batch file
* - Lightning827 - Jan 4, 2016 you should mabey add a for loop to this * - annikk.exe - Jan 4, 2016 (Jan 4, 2016 05:06 PM)wurd Wrote: Click and drag the programs you want to be cleaned onto the batch file Awesome demo gif. :> Very good to show people how it works! |