Sfoglia il codice sorgente

Upload files to 'CMD Wrapper'

added EF robocopy and bootstraper
delta 2 anni fa
parent
commit
b75cdd22a2
2 ha cambiato i file con 57 aggiunte e 0 eliminazioni
  1. 2
    0
      CMD Wrapper/EF-RbcBootstrap.bat
  2. 55
    0
      CMD Wrapper/EF-Robocopy-v1.4.ps1

+ 2
- 0
CMD Wrapper/EF-RbcBootstrap.bat Vedi File

@@ -0,0 +1,2 @@
1
+    %windir%\system32\WindowsPowerShell\v1.0\powershell.exe Unblock-File .\EF-Robocopy-v1.4.ps1
2
+    %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Unrestricted .\EF-Robocopy-v1.4.ps1

+ 55
- 0
CMD Wrapper/EF-Robocopy-v1.4.ps1 Vedi File

@@ -0,0 +1,55 @@
1
+if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
2
+    Start-Process PowerShell -Verb RunAs "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`"";
3
+    exit;
4
+}
5
+
6
+function backup {
7
+    $destdrive = read-host "Enter the drive letter of the destination drive and press Enter to continue."
8
+    $destfolder = read-host "Enter the name and CC# of the customer followed by your initials, in the format Last-First-00000-AA, and press Enter to continue."
9
+    ROBOCOPY C:\Users ${destdrive}:\${destfolder}\Users /E /COPY:DAT /DCOPY:DAT /XO /XJ /FP /ZB /ETA /XD "*Cache*" "*Code Cache*" "*cache2*" "*D3DSCache*" "*NVIDIACorp*"  "*Spotify*" "*CacheStorage*" "*wpnidm*" "*FileHistory*" "*PrimeVideo*" "*Netflix_*" "*MobileSync*" "*CrashReporter*" /XF "*.dll" "*.bin" "*.LOGGZ" /W:1 /R:2
10
+}
11
+
12
+function folder-restore {
13
+    $sourcedrive = read-host "Enter the drive letter of the source drive and press Enter to continue."
14
+    $sourcefolder = read-host "Enter the name of the source folder. (Example: Lisse-Brian-10101-BL)"
15
+    $restoredestdrive = read-host "Enter the drive letter of the destination drive (usually C) and press Enter to continue."
16
+    ROBOCOPY ${sourcedrive}:${sourcefolder}\Users ${restoredestdrive}:\OldDrv\Users /E /COPY:DAT /DCOPY:DAT /XO /XJ /FP /ZB /ETA /XD "*Cache*" "*Code Cache*" "*cache2*" "*D3DSCache*" "*NVIDIACorp*" "*Spotify*" "*CacheStorage*" "*wpnidm*" "*FileHistory*" "*PrimeVideo*" "*Netflix_*" "*MobileSync*" "*CrashReporter*" /XF "*.dll" "*.bin" "*.LOGGZ" /W:1 /R:2
17
+}
18
+
19
+function image-restore {
20
+    $sourcedrive = read-host "Enter the drive letter of the source drive and press Enter to continue."
21
+    $restoredestdrive = read-host "Enter the drive letter of the destination drive (usually C) and press Enter to continue."
22
+    ROBOCOPY ${sourcedrive}:\Users ${restoredestdrive}:\OldDrv\Users /E /COPY:DAT /DCOPY:DAT /XO /XJ /FP /ZB /ETA /XD "*Cache*" "*Code Cache*" "*cache2*" "*D3DSCache*" "*NVIDIACorp*" "*Spotify*" "*CacheStorage*" "*wpnidm*" "*FileHistory*" "*PrimeVideo*" "*Netflix_*" "*MobileSync*" "*CrashReporter*" /XF "*.dll" "*.bin" "*.LOGGZ" /W:1 /R:2
23
+}
24
+
25
+function restore-choice {
26
+    $answer2 = read-host "Are you restoring from a robocopy backup, or a restored image?
27
+1: Robocopy backup
28
+2: Restored image
29
+
30
+
31
+        
32
+(1/2)"                     
33
+            if ($answer2 -eq 1) {folder-restore} else {      
34
+            if ($answer2 -eq 2) {image-restore}
35
+            }
36
+    }
37
+
38
+$answer = read-host -prompt "Are you backing up or restoring?
39
+1: Backing up
40
+2: Restoring
41
+
42
+
43
+
44
+(1/2)"
45
+    
46
+    if ($answer -eq 1) {backup} else {
47
+    if ($answer -eq 2) {restore-choice}
48
+    }
49
+    
50
+
51
+sleep 1
52
+$PlayWav=New-Object System.Media.SoundPlayer
53
+$PlayWav.SoundLocation="C:\Windows\Media\Ring06.wav"
54
+$PlayWav.playsync()
55
+read-host "Robocopy operation complete. Press Enter to exit."

Powered by TurnKey Linux.