SET NET_DIR=\\192.168.64.100\work\ net use %NET_DIR% xxxxxxx /USER:xxxxxxx pushd %NET_DIR% forfiles /M *.txt /C "cmd /c if @isdir==FALSE del /s @path" /D -30 >> logdel.log popd