강좌 / 팁

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

2020.01.17 23:57

레마클로 조회:1712 추천: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 - - -
3589 소프트웨어| [엑셀팁] 숫자를 숫자 <-> 문자 포멧 전환하기 [6] 지후빠 1833 4 02-09
3588 윈 도 우| ContextMenu on/off [5] 레마클로 1416 14 02-08
3587 윈 도 우| 파일명 변경(+확장자제거) - 수정완료 [17] 레마클로 1736 10 02-08
3586 윈 도 우| PE 우측하단 워터마크에 시스템 정보 넣기 [6] 히이이잌 1613 11 02-06
3585 윈 도 우| PESE로 기존 PE에 기능 추가하기(내용추가) [16] 히이이잌 2943 29 02-05
3584 윈 도 우| 윈도우 10 최적화 설정 하기 [31] gooddew 10251 44 02-02
3583 윈 도 우| PrincePE_V18.5 [164] %카리스마 204975 99 02-02
3582 윈 도 우| 무선랜 토글 만들기 + α [8] 레마클로 2585 6 02-01
3581 하드웨어| [Tip] 노트북 배터리 수명 확인 [9] asklee 3295 5 01-30
3580 소프트웨어| 파이어폭스 자체 스크린캡쳐 기능 사용하기 [8] 클라크 706 4 01-30
3579 소프트웨어| AdGuard 확장기능(스크립트)으로 브라우저에 날개를 [6] 오호라7 2526 11 01-28
3578 윈 도 우| grub2 로 부팅 단축키 설정하기 [7] gooddew 1975 11 01-27
3577 윈 도 우| 유용한 CMD 명령어 정리 [7] gooddew 4139 18 01-26
3576 기 타| [정보] 윈도우10 쓰는 사람 필독 [10] ♣OSISO™ 8830 19 01-25
3575 윈 도 우| 집앞의_큰나무님의 "우클 PE 부팅" 원클릭화 (TE... [5] 레마클로 2173 7 01-23
3574 윈 도 우| 볼륨,소리 조절 nircmd.exe 이용 (vbscript) -- 수정된 첨... [7] 레마클로 1934 6 01-20
3573 윈 도 우| 기본 프린터 확인 및 테스트 페이지 인쇄 batch script [5] 컨피그 1468 9 01-19
» 윈 도 우| backup2VHD & 토글스위치(수정) [7] 레마클로 1712 13 01-17
3571 윈 도 우| 자료 mover(파일 첨부) [11] 레마클로 2545 20 01-16
3570 윈 도 우| 저장공간 확인 및 정리 [16] 레마클로 3145 17 01-15
XE1.11.6 Layout1.4.8