-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrestore_newest_from_here.bat
55 lines (46 loc) · 1.86 KB
/
restore_newest_from_here.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@echo off
cls
echo *******************************************************************************************
echo.
echo ** Killing Chrome
C:\Windows\System32\taskkill.exe -f -im chrome.exe
echo.
echo.
timeout 2
echo *******************************************************************************************
echo.
echo ** Copying Session from here into Chrome directory
echo.
del "%HOMEPATH%\AppData\Local\Google\Chrome\User Data\Default\Sessions\Session_*"
del "%HOMEPATH%\AppData\Local\Google\Chrome\User Data\Default\Sessions\Tabs_*"
:: all files are copied, but when resotoring, Chrome uses the newest files
robocopy "%CD%" "%HOMEPATH%\AppData\Local\Google\Chrome\User Data\Default\Sessions" "Session_*" "Tabs_*"
echo.
echo.
timeout 2
echo *******************************************************************************************
echo.
echo ** Starting Chrome
echo.
start " " "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
echo.
echo.
echo *******************************************************************************************
echo.
echo ** Done
echo.
timeout 30
GOTO EndComment
Robocopy Reference:
/X : Report all eXtra files, not just those selected & copied.
/V : Produce Verbose output log, showing skipped files.
/XD dirs [dirs]... : eXclude Directories matching given names/paths.
/E : Copy Subfolders, including Empty Subfolders.
/XO : eXclude Older - if destination file exists and is the same date
or newer than the source - don’t bother to overwrite it.
/XX : eXclude "eXtra" files and dirs (present in destination but not source)
This will prevent any deletions from the destination. (this is the default)
/MIR : MIRror a directory tree - equivalent to /PURGE plus all subfolders (/E)
/L only list dont copy
/XF file [file]... : eXclude Files matching given names/paths/wildcards.
:EndComment