For the test, I had written the ~ in front of the %% and not %% ~.
I'm annoyed myself that I haven't seen it.
But thanks for the input

Now it works

Code: Select all
for /F "delims=" %%i in ('"dir /s /b /a-d "\\Sharename\xyz\123\xxx 123\*.pvx" "') do (echo set file_date=%%~ti %%nxi)
Code: Select all
C:\Users\hrf3bw\Desktop>(echo set file_date=10.09.2020 13:21 %nxi )
set file_date=10.09.2020 13:21 %nxi