강좌 / 팁

윈 도 우 backup2VHD & 토글스위치(수정)

2020.01.17 23:57

레마클로 조회:1716 추천:13

 

backup2VHD 는 드래그 앤 드롭 시 W:\backup 폴더에 복사가 실행됩니다.

backup2VHD 폴더명 변경시 폴더명에 공백이 없게 해주세요.

아니면, 수정된 Backup-W-vhd.vbs로 교체하세요.(첨부파일)

드래그 앤 드롭 시 ->  여러파일, 폴더를 한번에 드래그 해도 됩니다.

실행파일은 Backup-W-vhd.vbs

 

BitLockDrive.exe 로 W:에 암호걸면 W:\Claunch.exe가 자동실행 안됩니다. Backup-W-vhd.vbs를 "많이" 손봐야합니다.

 

 

Backup-W-vhd.vbs (수정 -> curDir2 추가)

 

스크립트 시작

 

'--------------

 

If WScript.Arguments.length =0 Then

  Set objShell = CreateObject("Shell.Application")

  objShell.ShellExecute "wscript.exe", Chr(34) & _

  WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1

Else

 

'--------------

 

On Error Resume Next

Dim objFSO, outFile, curDir

Set objShell = WScript.CreateObject("WScript.Shell")

Set objFSO = CreateObject("Scripting.FileSystemObject") 

Set outFile = objFSO.CreateTextFile(".\vhdmt.txt", True)

Set outaFile = objFSO.CreateTextFile(".\vhdmta.txt", True)

Set outdFile = objFSO.CreateTextFile(".\vhdmtd.txt", True) 

curDir = objfso.GetParentFolderName(WScript.ScriptFullName)

curDir2 =  Chr(34) & curDir & Chr(34)

 

outFile.WriteLine "select vdisk file= """ & curDir & "\backup00.vhd"""

outFile.WriteLine "attach vdisk"

outFile.WriteLine "exit"

outFile.Close

 

outaFile.WriteLine "select vdisk file= """ & curDir & "\backup00.vhd"""

outaFile.WriteLine "select partition=1"

outaFile.WriteLine "assign letter=w"

outaFile.WriteLine "exit"

outaFile.Close

 

outdFile.WriteLine "select vdisk file= """ & curDir & "\backup00.vhd"""

outdFile.WriteLine "detach vdisk"

outdFile.WriteLine "exit"

outdFile.Close

 

objShell.Run "C:\Windows\System32\diskpart.exe /s " & curDir2 & "\vhdmt.txt""", 0, True

objShell.Run "C:\Windows\System32\diskpart.exe /s " & curDir2 & "\vhdmta.txt""", 0, True

 

objFSO.DeleteFile(".\vhdmt.txt")

objFSO.DeleteFile(".\vhdmta.txt")

 

'--------------

 

if objShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect") = 0 then

objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect", "1", "REG_DWORD"

objShell.Run"W:\utils\RExplore.exe", 1

else

end if

 

'--------------

 

filepath =  Chr(34) & "W:\Claunch.exe" & Chr(34)

objShell.Run filepath, , True

 

'--------------

 

msgbox "★ 백업 완료하셨나요? ★" +vbCrLf+ "" +vbCrLf+ "--- 아래 <확인>을 누르면 ," +vbCrLf+ "" +vbCrLf+ " 언마운트를 진행합니다.", &h51000, "백업용 VHD"

 

'--------------

 

if objShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect") = 1 then

objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect", "0", "REG_DWORD"

objShell.Run"W:\utils\RExplore.exe", 1

else

 

end if

 

objFSO.DeleteFolder("w:\$RECYCLE.BIN"), True

objShell.Run "C:\Windows\System32\diskpart.exe /s " & curDir2 & "\vhdmtd.txt""", 0, True

objFSO.DeleteFile(".\vhdmtd.txt")

 

'--------------

 

objShell.Popup "★ <백업용 VHD> 언마운트 완료 ★★" +vbCrLf+ "" +vbCrLf+ ".....수고하셨습니다.....", 2, "백업용 VHD", 4096

 

End If

 

스크립트 끝

 

MV2.png

 

참고로 이즈백히어,데어 = 일본프로그램입니다.

최신버전이고, 영어,일어 만 설정 가능.

사용법 - 이즈백세팅.exe 실행하여 설정 후 사용합니다.

          이즈백히어,데어.exe = 드래그앤드롭 방식.....

VHD 마운트 후 숨김해제 하면 utils 폴더 안에 있습니다.

 

 

숨김해제시 사용하세요.

tgl.png

 

tgl-Hidden.vbs

--------------

 

스크립트 시작

 

Const strComputer = "."

Dim WSHShell, OBJShell, curDir, objWMIService, colProcessList

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set OBJShell = CreateObject("Shell.Application") 

Set WSHShell = CreateObject("WScript.Shell")

Set fso = CreateObject("Scripting.FileSystemObject")

curDir = fso.GetParentFolderName(WScript.ScriptFullName)

strREfile = curDir & "\RExplore.exe"

If WScript.Arguments.length =0 Then

  OBJShell.ShellExecute "wscript.exe", Chr(34) & _

  WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1

else

 

Set colProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'Toggle.exe'")

For Each objProcess in colProcessList

 objProcess.Terminate()

Next

 

if WSHShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden") = 1 then

WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", 2, "REG_DWORD"

 

else

WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", 1, "REG_DWORD"

 

end if

 

WSHShell.Run Chr(34) & strREfile & Chr(34), 1

 

Set WSHShell = Nothing

Set OBJShell = Nothing

Set fso = Nothing

WScript.Quit(0)

end if

 

스크립트 끝

번호 제목 글쓴이 조회 추천 등록일
[공지] 강좌 작성간 참고해주세요 gooddew - - -
3578 윈 도 우| grub2 로 부팅 단축키 설정하기 [7] gooddew 1981 11 01-27
3577 윈 도 우| 유용한 CMD 명령어 정리 [7] gooddew 4143 18 01-26
3576 기 타| [정보] 윈도우10 쓰는 사람 필독 [10] ♣OSISO™ 8832 19 01-25
3575 윈 도 우| 집앞의_큰나무님의 "우클 PE 부팅" 원클릭화 (TE... [5] 레마클로 2173 7 01-23
3574 윈 도 우| 볼륨,소리 조절 nircmd.exe 이용 (vbscript) -- 수정된 첨... [7] 레마클로 1936 6 01-20
3573 윈 도 우| 기본 프린터 확인 및 테스트 페이지 인쇄 batch script [5] 컨피그 1473 9 01-19
» 윈 도 우| backup2VHD & 토글스위치(수정) [7] 레마클로 1716 13 01-17
3571 윈 도 우| 자료 mover(파일 첨부) [11] 레마클로 2550 20 01-16
3570 윈 도 우| 저장공간 확인 및 정리 [16] 레마클로 3148 17 01-15
3569 윈 도 우| 설치된 기본프린터 확인 및 테스트페이지 인쇄 vbscript [25] 레마클로 2550 23 01-14
3568 윈 도 우| 마이크로소프트 윈도우 라이선스 정리 [7] gooddew 5214 14 01-11
3567 소프트웨어| SearchPreview - 웹 사이트의 미리보기 이미지 - Firefox +... VenusGirl 1216 2 01-06
3566 윈 도 우| PE 부팅 파티션 만들기 (legacy) [13] gooddew 3775 15 01-05
3565 기 타| Manjaro 리눅스 - 처음 설치 기본 가이드 [4] VenusGirl 2942 6 01-05
3564 소프트웨어| 배치파일 사용자 설정 파일 구현하기 [4] 히이이잌 2273 9 01-01
3563 소프트웨어| 데이터 영구 삭제 [5] gooddew 3044 8 01-01
3562 소프트웨어| 기상 정보-Forecastfox - Firefox+Google Chrome용 부가 기능 [3] VenusGirl 1175 9 12-31
3561 하드웨어| BIOS, CMOS, UEFI 는 무엇인가? [15] gooddew 3888 19 12-31
3560 윈 도 우| [UEFI] 부팅 PE 파티션 설치하기 [19] gooddew 6340 29 12-28
3559 기 타| elementary OS 5.1 Hera 설치 초보자 가이드 [1] VenusGirl 2141 3 12-27
XE1.11.6 Layout1.4.8