I currently have this script I run as a scheduled task:
@echo on
START /WAIT c:\windows\system32\Robocopy.exe "D:\folder" "\\192.168.2.87\folder" /E /MT:20 /R:50 /W:10 /V /ETA /LOG:c:\robocopy.txt
I want to convert and run this as a PowerShell script because of two reasons:
- Its more modern
- The most important reason is that I want to store the log with date and time as
C:\robocopylog3004201510214043.txtand I am literally finding no information on how to strip characters like ":" and "/" from a batch script and I know PowerShell can.
That last number is not random. It is the date and time.
Date for example is "30/04/2015" (striping it would leave 30042015) Time for example is "10:21:40,43" (striping it would leave 10214043)
So it would leave a file name of robocopylog3004201510214043.txt