hi
is there any option to start a bat to move my logfiles form server by putting the bat inside the folder and just open the folder?
start bat when open folder
Moderator: DosItHelp
Re: start bat when open folder
No there is no option. If "open the folder" means you display the folder content in the file explorer then you would have to programmatically change the behavior of explorer.exe (or whatever file explorer you use).
If the target where to move the log files is always the same then you could place a script into the SendTo folder (probably "%APPDATA%\Microsoft\Windows\SendTo") to have it in the "Send to" menu item if you right click on the folder.
Instead of ECHOing the found files you have to apply your move command. But since you don't provide detailed information I can't help any further.
Steffen
If the target where to move the log files is always the same then you could place a script into the SendTo folder (probably "%APPDATA%\Microsoft\Windows\SendTo") to have it in the "Send to" menu item if you right click on the folder.
Code: Select all
@echo off &setlocal
if "%~1"=="" exit /b
if not exist "%~1\" exit /b
for /r "%~1" %%i in ("*.log") do (
echo found "%%~i"
)
pause
Steffen