[경로] RegDelete [키] | [값]
RegDelete의 경로 (Windows에서 찾을 수 있음). Windows 98 Tips and Hacks 페이지의 팁을 참조하면 Windows에서 항상 찾을 수 있습니다.
Nothing 사용자 인터페이스로 RegDelete를 시작합니다. 삭제할 키 또는 값을 입력 할 때 키 또는 값을 거꾸로 쉼표로 묶지 마십시오.
키 삭제할 키입니다. 키는 항상 백 슬래시로 끝납니다. 키에 공백이 있으면 역 콤마로 묶어야합니다. 키와 하위 키가 삭제됩니다.
값 삭제할 값입니다. 값 뒤에 백 슬래시가 없습니다. 키에 공백이 있으면 역 콤마로 묶어야합니다.
새 텍스트 문서에 다음 줄을 복사하고 RegDelete.vbs 파일로 저장하십시오.
'RegDelete.vbs
'Deletes keys or values from the registry.
'
'
On Error Resume Next
vbPara=vbCRLF & vbCRLF
strExplain="RegDelete deletes keys and values from the registry." & vbPara & "Keys must end with a backspace and values must not." & vbPara & "Start without parameters to type in a key or value to delete, or place the key or value on the command line (use inverted commas to surround the key or value if it contains spaces)." & vbPara & "Continue"
strTitle="Reg Delete"
Key=""
Dim silent
Silent=""
Dim Sh
Set Sh = WScript.CreateObject("WScript.Shell")
ReportErrors "Creating Shell"
Key=GetKey()
If Key<>"" then
B=Sh.RegRead (Key)
If Err.Number=0 Then
Sh.RegDelete Key
If Err.Number =0 Then
If silent<>"yes" Then MsgBox Key & " deleted", vbOKOnly + vbInformation, strTitle
Else
ReportErrors "DeletingKey"
End If
Else
If Err.Number=-2147024893 then
Err.Clear
MsgBox Key & " didn't exist", vbOKOnly + vbCritical, strTitle
Else
ReportErrors "Reading before Deleting Key"
End If
End If
End If
ReportErrors "Main"
Function GetKey()
Dim Ag
Set Ag=Wscript.Arguments
ReportErrors "Creating Aguments"
If Ag.Count=1 then GetKey=Ag(0)
Silent="yes"
If Ag.Count >1 then sgBox "Too many parameters on command line. Try enclosing the key in a space",vbOKOnly + vbCritical, strTitle
If Ag.Count=0 then
If MsgBox (strExplain, vbYesNo + vbInformation, strTitle)=6 Then
GetKey=InputBox ("Enter the value or key to delete." & vbPara & "Keys must end in a backspace.", strTitle, strNamet1)
End If
End If
End Function
Sub ReportErrors(strModuleName)
If err.number<>0 then Msgbox "Error occured in " & strModuleName & " module of " & err.number& " - " & err.description & " type" , vbCritical + vbOKOnly, "Something unexpected"
Err.clear
End Sub
Regdelete. \로 끝나면 반드시 키 여야합니다. \ 다음에 값이 없습니다. 키는 폴더입니다. –
@tony bd : 작동하지 않습니다. – jaxb
작동하지 않는 기능 - Sh.RegDelete "HKCR \ .txt \"가 키를 삭제합니다. Sh.RegDelete "HKCR \ .txt \ ShellNew"는 ShellNew 키의 기본값 Sh.RegDelete " HKCR \ .txt \ ShellNew \ NullFile "은 nullfile이라는 값을 삭제합니다. –