hello to all,
I want to make a simple batch file to back files from a folder on my laptop to a folder on my PC when I'm using the laptop at home.
I intend to put it in the startup folder to run every time it starts up. I used a simple "if exist" command to check if the Pc folder is available and used a loop to re-try 3 times (allowing time for network connection)
I would like to only back up files that have been changed within the last 2 days.
I started thinking that i could use "date /t >>c:\date.txt" to output it and then bring it back in as a value, then use that value with the Xcopy command with the date switch.
The problem is that the date /t command outputs in the dd/mm/yy format when the Xcopy command is expecting dd-mm-yy
Is there any way to change the format or even read just parts of a txt file line and use the dd, mm and yy on their own. (ie, date /d:%dd%-%mm%-%yy% or something)
any ideas?
I want to make a simple batch file to back files from a folder on my laptop to a folder on my PC when I'm using the laptop at home.
I intend to put it in the startup folder to run every time it starts up. I used a simple "if exist" command to check if the Pc folder is available and used a loop to re-try 3 times (allowing time for network connection)
I would like to only back up files that have been changed within the last 2 days.
I started thinking that i could use "date /t >>c:\date.txt" to output it and then bring it back in as a value, then use that value with the Xcopy command with the date switch.
The problem is that the date /t command outputs in the dd/mm/yy format when the Xcopy command is expecting dd-mm-yy
Is there any way to change the format or even read just parts of a txt file line and use the dd, mm and yy on their own. (ie, date /d:%dd%-%mm%-%yy% or something)
any ideas?