bat file in win 10 startup folder
It is not safe. First you need check the existence of the folder before changing current directory to it.
@echo off
set "_path=C:\Users\%USERNAME%\AppData\Local\Temp"
if exist "%_path%" (
cd "%_path%"
del /F /Q *.*
)