0

I am trying to make a bat script that uploades the newest file from a folder to the public html. How to do this? I got this to work at the moment.

c:pscp -pw password c:\index.html user@host:public_html/index.html
Coolcrab
  • 2,655
  • 9
  • 39
  • 59

1 Answers1

0

Got it:

set source="C:\dir"
FOR /F "delims=|" %%I IN ('DIR %source% /B /O:D') DO SET NewestFile=%%I

c:pscp -pw password %source%\%NewestFile% user@host:public_html/%NewestFile%

pause
Coolcrab
  • 2,655
  • 9
  • 39
  • 59