日期:2014-05-17 浏览次数:21281 次
Imports System.Text.RegularExpressions
Module Module1
Sub Main(args() As String)
Try
If args.Length = 2 AndAlso args(0) = "-uninstalled" Then
'{5E705D88-92D1-4C0C-ADEF-836F41429E7A}
If Regex.IsMatch(args(1), "^\{[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}\}$", RegexOptions.IgnoreCase) Then
Using Process.Start(System.Environment.SystemDirectory & "\msiexec.exe", "/x """ & args(1) & """")
End Using
End If
End If
Catch ex As Exception
End Try
Environment.Exit(0)
End Sub
End Module
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Text.RegularExpressions;
static class Module1
{
public static void Main(string[] args)
{
try {
if (args.Length == 2 && args[0] == "-uninstalled") {
//{5E705D88-92D1-4C0C-ADEF-836F41429E7A}
if (Regex.IsMatch(args[1], "^\\{[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}\\}$", RegexOptions.IgnoreCase)) {
using (Process.Start(System.Environment.SystemDirectory + "\\msiexec.exe", "/x \"" + args[1] + "\"")) {
}
}
}
} catch (Exception ex) {
}
Environment.Exit(0);
}
}