becca.smith
becca.smith.001
becca.smith.002
but I realized that i'll have issues with similar username such as "rebecca.smith", where becca.smith and rebecca.smith are 2 unique users.
In this example, What's the right way to do this without deleting rebecca.smith? or am i going about this entirely wrong?
Since this doesn't work: FileRemoveDir, \\path\users\becca.smith*, 1
My workaround to loop the directory, then match foldername with IfInString, would remove both users, becca.smith as well as rebecca.smith
Code: Select all
username = becca.smith
loop, \\path\users\*, 2, 0
{
IfInString, a_loopfilename, %username%.
FileRemoveDir, %A_LoopFileFullPath%, 1
}