Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Shell("rundll32 setupapi,InstallHinfSection DefaultInstall 128 .\TonDossierInf\TonFichierInf.INF")
End Sub
RunDll32.exe setupapi,InstallHinfSection DefaultInstall 132 ton_fichier.inf
Version]
Signature="$CHICAGO$"
[Optional Components]
MyRegTweaks
[DefaultInstall]
AddReg =REGEntries.AddReg
DelReg =REGEntries.DelReg
[MyRegTweaks]
OptionDesc ="Registry Entries"
Tip ="Registry Entries"
Modes =0,1,2,3
AddReg =REGEntries.AddReg
DelReg =REGEntries.DelReg
[REGEntries.AddReg]
; Reg2Inf v0.46 - http://tinyurl.com/fgqyf
HKCR,"Directory\Background\shell\Start DWM",,0x0,"Activer l'Aéro"
HKCR,"Directory\Background\shell\Start DWM\command",,0x0,"net start uxsms"
HKCR,"Directory\Background\shell\Stop DWM",,0x0,"Désactiver l'Aéro"
HKCR,"Directory\Background\shell\Stop DWM\command",,0x0,"net stop uxsms"
[REGEntries.DelReg]
; Reg2Inf v0.46 - http://tinyurl.com/fgqyf
[Version] Signature=$CHICAGO$ [DefaultInstall] AddReg=Add.Settings1,Add.Settings2,Add.Settings3 [Add.Settings1] HKCR,"Directory\Background\shell\Start DWM",,0x0,"Activer l'Aéro" [Add.Settings2] HKCR,"Directory\Background\shell\Start DWM\command",,0x0,"net start uxsms" [Add.Settings3] HKCR,"Directory\Background\shell\Stop DWM",,0x0,"Désactiver l'Aéro" [Add.Settings4] HKCR,"Directory\Background\shell\Stop DWM\command",,0x0,"net stop uxsms"
Public Sub OpenProgram(ByVal Filename As String, ByVal Arguments As String, ByVal Wait As Boolean, ByVal WindowsStyle As ProcessWindowStyle) Dim processStartInfo1 As ProcessStartInfo = New ProcessStartInfo() processStartInfo1.FileName = Filename If Operators.CompareString(Arguments, "", False) <> 0 Then processStartInfo1.Arguments = Arguments End If processStartInfo1.WindowStyle = WindowsStyle Dim string1 As String = Filename If string1.Contains("") Then While string1.Contains("") string1 = string1.Substring(1) End While End If Dim process1 As Process = Process.Start(processStartInfo1) If Wait Then Module1.WaitToFinish(string1) End If End Sub
Public Sub WaitToFinish(ByVal AppExe As String) Dim processArray1 As Process() = Nothing Dim exception1 As Exception = Nothing If AppExe.Contains(".exe") Then While Not AppExe.EndsWith(".") AppExe = AppExe.Substring(0, (DirectCast((AppExe.Length - 1), Integer))) End While AppExe = AppExe.Substring(0, (DirectCast((AppExe.Length - 1), Integer))) End If Dim i1 As Integer = 0 Try While i1 <> 1 processArray1 = Process.GetProcessesByName(AppExe) i1 = 0 For Each process1_1 As Process In processArray1 i1 = 1 Next End While While i1 <> 0 processArray1 = Process.GetProcessesByName(AppExe) i1 = 0 For Each process1 As Process In processArray1 i1 = 1 Next End While Catch exception2 As Exception exception1 = exception2 ProjectData.SetProjectError(exception1) Dim msgBoxResult1 As MsgBoxResult = Interaction.MsgBox(exception1.Message, MsgBoxStyle.ApplicationModal, Nothing) ProjectData.ClearProjectError() End Try End Sub
OpenProgram("cmd.exe", " /c InfDefaultInstall.exe C:\TonFichierInf.INF", True, ProcessWindowStyle.Hide)
Au fait (par ailleurs) : pourquoi passer forcément par une modification de la BDR pour activer ou désactiver Aero ?
Je crois savoir que tu peux faire ces opérations ainsi (en appelant dans le shell)
Pour activer
rundll32.exe dwmApi # 104
Pour désactiver
rundll32.exe dwmApi #102 rundll32.exe dwmApi # 102