-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimport_lna.bat
59 lines (37 loc) · 1.79 KB
/
import_lna.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
56
57
58
59
REM @echo off
echo debut de traitement - %date% - %time%
set "reg_path=\\01-gtw-01\upd\Profils_LNA\REGISTRE"
if not exist "\\01-gtw-01\upd\Profils_LNA\REGISTRE\%username%" mkdir "\\01-gtw-01\upd\Profils_LNA\REGISTRE\%username%"
REG QUERY "HKCU\SOFTWARE\UES" | Find "LNA"
IF %ERRORLEVEL% == 0 goto key_found
If %ERRORLEVEL% == 1 goto key_not_found
:key_found
echo --------- Cle existante - backup --------- >> %reg_path%\%username%\%username%.log
echo backup vers %reg_path%\%username%\%username%-backup.cfu
regedit /e %reg_path%\%username%\%username%-backup.cfu HKEY_CURRENT_USER\SOFTWARE\UES\LNA
if exist %reg_path%\%username%\%username%.cfu (
echo import de %reg_path%\%username%\%username%.cfu >> %reg_path%\%username%\%username%.log
REM Suppression des anciennes clés
reg delete HKEY_CURRENT_USER\Software\UES\LNA /f
REM Import des clés
regedit /S %reg_path%\%username%\%username%.cfu
REM Maj Chemin
regedit /S %reg_path%\Update_Path.cfu /f
REM Backup du fichier importé
move %reg_path%\%username%\%username%.cfu %reg_path%\%username%\%username%-import.cfu
)
goto end
:key_not_found
echo --------- Cle non existante - import --------- >> %reg_path%\%username%\%username%.log
if exist %reg_path%\%username%\%username%.cfu (
echo import de %reg_path%\%username%\%username%.cfu >> %reg_path%\%username%\%username%.log
regedit /S %reg_path%\%username%\%username%.cfu
regedit /S %reg_path%\Update_Path.cfu /f
move %reg_path%\%username%\%username%.cfu %reg_path%\%username%\%username%-import.cfu
) else (
echo import de %reg_path%\default.cfu >> %reg_path%\%username%\%username%.log
regedit /i /S %reg_path%\default.cfu >> %reg_path%\%username%\%username%.log
)
goto end
:end
@exit