'--------------------------------------------------------------------------------------------
' Désinstalle 'Reparer par ligne de commande ver 1.0'
' Auteur : IDEOVA\vodiem - 13 jan 2012
'--------------------------------------------------------------------------------------------
On Error Resume Next
Set WshShell = WScript.CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set WshProcessEnv = WshShell.Environment("Process")

VBSPathDst = WshProcessEnv("ProgramFiles") & "\IDEOVA"
If oFSO.FolderExists(VBSPathDst) Then
	If oFSO.FolderExists(VBSPathDst) & "\VBS" Then
		oFSO.DeleteFile VBSPathDst & "\VBS\access - reparer par ligne de commande.vbs"
		If (oFSO.GetFolder(VBSPathDst & "\VBS").SubFolders.Count = 0) AND (oFSO.GetFolder(VBSPathDst & "\VBS").Files.Count = 0) Then oFSO.DeleteFolder(VBSPathDst & "\VBS")
		If (oFSO.GetFolder(VBSPathDst).SubFolders.Count = 0) AND (oFSO.GetFolder(VBSPathDst).Files.Count = 0) Then oFSO.DeleteFolder(VBSPathDst)
	End If
End If

DelTo "mdb"
DelTo "accdb"

MsgBox "Désinstallation terminée."

Sub DelTo(fileExtension)
	Set WshShell = WScript.CreateObject("WScript.Shell")
	assoc = WshShell.RegRead ("HKCR\." & fileExtension & "\")
	WshShell.RegDelete "HKCR\" & assoc & "\shell\RepairByCMD\command\"
	WshShell.RegDelete "HKCR\" & assoc & "\shell\RepairByCMD\"
End Sub
