Originally created by: kijoshua...@gmail.com
/*
This was from a while ago! I made this script to cleanup folders after
unzipping many
things at once. I always hated how some would zip their folders while
others would zip
their items. I just ended up extracting to a folder every time and then
checking each
folder to see if it was redundant or not. Like
finding
...\mystuff\mystuff\<files>
and fixing it to be
...\mystuff\<files>
All this does is spills any selected folder that contains precisely one
folder and no files.
*/
loop %0%
{
folder := %A_Index%
files := 0
loop, %folder%\*.*
files++
folders := 0
loop, %folder%\*.*, 2
{
folders++
real_folder = %A_LoopFileFullPath%
real_fname = %A_LoopFileName%
}
if (files = 0) and (folders = 1)
{
StringGetPos,break,folder,\,[r1]
StringLeft,dest,folder,%break%
StringGetPos,break,dest,\,[r1]
StringRight,dest_fname,dest,%break%
;MsgBox, changing %real_folder% to %dest%\%real_fname%
FileMoveDir, %real_folder%, %dest%\%real_fname%, 2
if ErrorLevel
MsgBox, error changing %real_folder% to %dest%\%real_fname%
else if dest_fname <> %real_fname%
FileRemoveDir, %folder%
}
if (files = 0) and (folders = 0)
FileRemoveDir, %folder%
}
QUIT:
return
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tortoisesvn
(No comment was entered for this change.)
Labels: -Type-Defect command
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: kijoshua...@gmail.com
Compiled version (doesn't require AutoHotKey to run)