Simple answer based on the code given? Just add a default parameter to your geraarquivos function and pass the path to the lambda your using for the button command - lambda: geraarquivos(pasta_label.cget('text')).
geraarquivos
lambda: geraarquivos(pasta_label.cget('text'))