Repository navigation
Expand file tree
/
Copy pathCompMigrationTool.bat
More file actions
258 lines (201 loc) · 7.86 KB
/
Copy pathCompMigrationTool.bat
File metadata and controls
258 lines (201 loc) · 7.86 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
@Echo Off
Title Windows Computer Migration Tool
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: ~~~~~~~~~~~~ Variable Registry ~~~~~~~~~~~~
:: CHROME
::
Set ADLGoogle=%drivetarget%:\Users\%username%\AppData\Local\Google
Set ADRGoogle=%drivetarget%:\Users\%username%\AppData\Roaming\Google
SET chrotarget1=Bookmarks
SET chrotarget2=Bookmarks.bak
:: FIREFOX
::
Set ADLFirefox=%drivetarget%:\Users\%username%\AppData\Local\Mozilla
Set ADRFirefox=%drivetarget%:\Users\%username%\AppData\Roaming\Mozilla
SET firetarget1=places.sqlite
SET firetarget2=places.sqlite-shm
SET firetarget3=places.sqlite-wal
:: INTERNET EXPLORER
::
SET iedir="%drivetarget%\Users\%username%\Favorites"
:: EDGE
::
SET edgedir=
:: UNIQUE DIRECTORIES / VARIABLES
::
SET sr=".\script_resources"
SET rclog=".\BACKUP_DATA\DataMigrationLog.txt"
:: USER DATA BACKUP DIRECTORIES
::
Set Contacts=%drivetarget%:\Users\%username%\Contacts
Set Desktop=%drivetarget%:\Users\%username%\Desktop
Set Documents=%drivetarget%:\Users\%username%\Documents
Set Downloads=%drivetarget%:\Users\%username%\Downloads
Set Favorites=%drivetarget%:\Users\%username%\Favorites
Set Links=%drivetarget%:\Users\%username%\Links
Set Music=%drivetarget%:\Users\%username%\Music
Set Pictures=%drivetarget%:\Users\%username%\Pictures
Set Searches=%drivetarget%:\Users\%username%\Searches
Set Videos=%drivetarget%:\Users\%username%\Videos
:: MICROSOFT OFFICE APP DATA DIRECTORIES
::
Set ADRMDBB=%drivetarget%:\Users\%username%\AppData\Roaming\Microsoft\"Document Building Blocks"
Set ADRMCrypto=%drivetarget%:\Users\%username%\AppData\Roaming\Microsoft\Crypto
Set ADRMProof=%drivetarget%:\Users\%username%\AppData\Roaming\Microsoft\Proof
Set ADRMProtect=%drivetarget%:\Users\%username%\AppData\Roaming\Microsoft\Protect
Set ADRMSignatures=%drivetarget%:\Users\%username%\AppData\Roaming\Microsoft\Signatures
Set ADRMStationery=%drivetarget%:\Users\%username%\AppData\Roaming\Microsoft\Stationery
Set ADRMSysCert=%drivetarget%:\Users\%username%\AppData\Roaming\Microsoft\SystemCertificates
Set ARMUProof=%drivetarget%:\Users\%username%\AppData\Roaming\Microsoft\UProof
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
goto start
=======================================================
--------------------- To-Do List ----------------------
=======================================================
- Fetch Web Browser Profile
Edge
- List of Intsalled applications
=======================================================
--------------------- CHANGE LOG ----------------------
=======================================================
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
:start
Echo.
Echo =======================================================
Echo -------- Windows Computer Migration Tool v0.1 ---------
Echo =======================================================
:: ~~~~~~~~~~~~ Check for Admin ~~~~~~~~~~~~
::
Echo.
Echo Checking Administrative Rights....
openfiles>nul 2>&1
if %errorlevel% EQU 0 goto startscript
Echo.
Echo In order for this script to run properly, it is necessary
Echo for the script to have Administrative Rights.
Echo.
Echo Please rerun this script as an Administrator.
Echo.
Echo Press Enter to close the script...
pause>nul
exit
:startscript
Echo.
Echo The script is running with elevated rights.
::
:: ~~~~~~~~~~~~ Start ~~~~~~~~~~~~
::
:: Navigate to Folder where Script Exists
::
cd %~dp0
:: Create folder for Backup Repository
::
mkdir .\BACKUP_DATA
SET mdrepo=".\BACKUP_DATA"
:: Inquire Target Drive
::
SET /P drivetarget=What is the target Drive Letter? [Default = C:\]:
If "%drivetarget%" EQU "" SET driveletter=C
::
:: ~~~~~ PST FILES ~~~~~
::
:: Backup PST Files using PS
::
Powershell.exe -ExecutionPolicy Bypass -Command .\%sr%\PSTFinder.ps1
:: PST should have been created at C:\PSTRepo. This will move them to external media.
::
SET rctarget="%drivetarget%\PSTRepo"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
::
:: ~~~~~ WEB BROWSER DATA ~~~~~
::
:: CHROME
::
SET repo=Chrome_DATA
mkdir %mdrepo%\%repo%
SET rctarget="%drivetarget%\%ADLGoogle%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%ADRGoogle%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
:: FIREFOX
::
SET repo=Firefox_DATA
mkdir %mdrepo%\%repo%
SET rctarget="%drivetarget%\%ADLFirefox%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%ADRFirefox%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
:: IE
::
SET repo=IE_DATA
mkdir %mdrepo%\%repo%
SET rctarget="%drivetarget%\%Favorites%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
:: EDGE
::
::mkdir %mdrepo%\Edge_DATA
::SET rctarget="%drivetarget%\%%"
::SET rclog=".\BACKUP_DATA\LOGS\"
::ROBOCOPY %rctarget% .\BACKUP_DATA\PST_Files /E /ZB /J /COPYALL /XJD /R:3 /W:10 /FFT /LOG:"%rclog%" /V
::
:: ~~~~~ MICROSOFT OFFICE ~~~~~
::
:: Office AppData
::
SET repo=Office_DATA
mkdir %mdrepo%\%repo%
SET rctarget="%drivetarget%\%ADRMDBB%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%ADRMCrypto%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%ADRMProof%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%ADRMProtect%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%ADRMSignatures%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%ADRMStationery%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%ADRMSysCert%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%ARMUProof%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
::
:: ~~~~~ GENERAL USER DATA ~~~~~
::
:: User Data
::
SET repo="User_DATA-%username%"
mkdir %mdrepo%\%repo%
SET rctarget="%drivetarget%\%Contacts%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%Desktop%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%Documents%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%Downloads%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%Favorites%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%Links%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%Music%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%Pictures%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%Searches%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
SET rctarget="%drivetarget%\%Videos%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V
exit
::
::
::
::
::
:: COMMANDS
SET repo=
mkdir %mdrepo%\%repo%
SET rctarget="%drivetarget%\%%"
ROBOCOPY %rctarget% %mdrepo%\%repo% /E /ZB /J /COPYALL /XJD /R:3 /W:1 /FFT /LOG+:"%rclog%" /V