Drive Snapshot

Discussion in 'backup, imaging & disk mgmt' started by Hadron, Nov 11, 2019.

  1. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    What do you do? Close the command window or press Enter?
     
  2. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    I just press any key as usual.

    It says: hit ANY Key to continue
     
  3. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    In that case run my script as written. No edits apart from your path. And HD1.
     
  4. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
  5. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    The Recycle Bin switch worked. :geek:
     
  6. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    Did you get an Entire-1 folder containing your images?
     
  7. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    No change. Same result.
    Have a look at the command prompt window. Is HD1 correct? You use HD3. How do I know? It has always restored nicely for me on 3 computers.

    DS.jpg
     
  8. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    The backup from HD1 is fine but did you take the screenshot before it finished?

    Try this...

    Code:
    ::@echo off
    CD /d %~dp0
    ::if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -o -L0 -R --UseVSS -W
    MD hadron
    MOVE *.sna hadron
    
    pause
    
    
    IF EXIST Entire-3 (RD Entire-3 /s /q)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN Backup Entire-1
    
    pause
    You will see the command window. Don't do anything at the first pause. I saw this...

    It shows hadron being created and the files being moved. What do you see after "Snapshot finished successfully"?
     
  9. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    Yes, I took the screenshot as it was progressing.
    Doing the one above now.
     
  10. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    Understood.
     
  11. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    Look what's happening, Brian.
    Look where it's creating everything.

    DS2.jpg
     
  12. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    But it's not doing much in there either.
    Look at the folder sizes.

    DS3.jpg
     
  13. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    Nice find. Excellent. A few questions.
    Is snapshot64.exe in D:\System_Backup\Drive_Snapshot?
    Is your batch file in D:\System_Backup\Drive_Snapshot?
    Are you running the batch file as an Admin?
     
  14. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    snapshot64.exe is in the default folder of: C:\Program Files (x86)\Snapshot
    I know it's portable, but I installed it for some reason.

    The batch is in the same folder: C:\Program Files (x86)\Snapshot

    Yes, I am running as Admin.
     
  15. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    OK, your snapshot64.exe isn't in D:\System_Backup\Drive_Snapshot

    You can either move it to that folder or change the script to...

    Code:
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -o -L0 -R --UseVSS -W
    
    CD /d D:\System_Backup\Drive_Snapshot
    
    MD hadron
    Does that work now?

    Edit.... your batch file should be in D:\System_Backup\Drive_Snapshot
     
  16. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    I am going to move my batches over to a sub-folder in the D:\System_Backup\Drive_Snapshot folder.
    That's how I done the IFWRotate batch.
     
  17. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    I now have the batches in: D:\System_Backup\Drive_Snapshot\Batches
     
  18. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    CD /d %~dp0

    Means CD to this folder. We want D:\System_Backup\Drive_Snapshot to be "this folder".
     
  19. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    The batch files need to be in D:\System_Backup\Drive_Snapshot for CD /d %~dp0 to work. Not in a sub folder.

    You can have them in a sub folder if you use...

    CD /d D:\System_Backup\Drive_Snapshot
     
  20. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    I am about to run this. Is that right.

    Code:
    ::@echo off
    CD /d D:\System_Backup\Drive_Snapshot
    ::if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -o -L0 -R --UseVSS -W
    
    CD /d D:\System_Backup\Drive_Snapshot
    
    MD hadron
    MOVE *.sna hadron
    IF EXIST Entire-3 (RD Entire-3 /s /q)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN hadron Entire-1
     
  21. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    Make it...

    Code:
    @echo off
    
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -o -L0 -R --UseVSS -W
    
    CD /d D:\System_Backup\Drive_Snapshot
    
    MD hadron
    MOVE *.sna hadron
    IF EXIST Entire-3 (RD Entire-3 /s /q)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN hadron Entire-1
     
  22. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    OK.
    I tried the previous one, and it didn't run.
     
  23. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    Put the first...

    CD /d D:\System_Backup\Drive_Snapshot

    back if snapshot64 doesn't start.
     
  24. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,138
    That's not running either.
    I see a quick flash of the command prompt window, then nothing.
    I ran it as Admin.
     
  25. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,146
    Location:
    NSW, Australia
    OK. Put snapshot64.exe and your batch file in D:\System_Backup\Drive_Snapshot

    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -o -L0 -R --UseVSS -W
    
    CD /d D:\System_Backup\Drive_Snapshot
    
    MD hadron
    MOVE *.sna hadron
    
    IF EXIST Entire-3 (RD Entire-3 /s /q)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN Backup Entire-1
    
    
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.