marabunta
Goto Top

Windows Update Popup erscheinen lassen

Hallo,

Windows8 x64
Nach einem manuellem Update, ist es möglich das Windows Update Popup für den User anzeigen zu lassen mit dem Timer zum neustart?
z.b. firefox wird geupdated dann wird das popup geöffnet 10min zeit oder in 4h etc..

Content-ID: 272771

Url: https://administrator.de/forum/windows-update-popup-erscheinen-lassen-272771.html

Ausgedruckt am: 13.04.2025 um 18:04 Uhr

tomolpi
tomolpi 24.05.2015 um 17:56:30 Uhr
Goto Top
Hallo,

die Updates für den Firefox werden nicht per Windows Update ausgeliefert, der ist nämlich von Mozilla und nicht von MS...


tomolpi
Marabunta
Marabunta 24.05.2015 um 20:56:59 Uhr
Goto Top
das weiß ich, es ist aber irrelevant wenn ich die meldung manuell aufrufen kann
114757
114757 24.05.2015 aktualisiert um 21:09:49 Uhr
Goto Top
Zitat von @Marabunta:
das weiß ich, es ist aber irrelevant wenn ich die meldung manuell aufrufen kann
Da müsstest du schon die Windows DLLs analysieren ... IMHO ist es einfacher sich selber die Funktionalität nachzubauen, geht auch mit Powershell ohne das ein Powershell-Fenster zu sehen ist.

Gruß jodel32
colinardo
Lösung colinardo 25.05.2015, aktualisiert am 01.06.2015 um 21:29:43 Uhr
Goto Top
Moin Marabunta,
wenn eine sehr ähnliche nachgebaute Variante des Dialogs nichts ausmacht face-smile:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
$showWindowAsync = Add-Type –memberDefinition @” 
[DllImport("user32.dll")]   
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); 
“@ -name “Win32ShowWindowAsync” -namespace Win32Functions –passThru

function Hide-PowerShell() { 
    [void]$showWindowAsync::ShowWindowAsync((Get-Process –id $pid).MainWindowHandle, 2) 
}

#region Import the Assemblies
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null  
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null  
#endregion

#region Generated Form Objects
$formReminder = New-Object System.Windows.Forms.Form
$lblTitle = New-Object System.Windows.Forms.Label
$pbIcon = New-Object System.Windows.Forms.PictureBox
$comboDelay = New-Object System.Windows.Forms.ComboBox
$label2 = New-Object System.Windows.Forms.Label
$btnDelay = New-Object System.Windows.Forms.Button
$btnReboot = New-Object System.Windows.Forms.Button
$label1 = New-Object System.Windows.Forms.Label
$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState
$timer = New-Object System.Windows.Forms.Timer
$waittime = 0
#endregion Generated Form Objects

#Provide Custom Code for events specified in PrimalForms.
$handler_btnReboot_Click= 
{
    $timer.Stop()
    $timer.Dispose()
    $formReminder.Close()
    shutdown -r -t 0
}

$handler_btnDelay_Click= 
{
    switch ($comboDelay.SelectedIndex){
        0{$waittime = 600*1000}
        1{$waittime = 1800*1000}
        2{$waittime = 3600*1000}
        3{$waittime = 7200*1000}
        4{$waittime = 4*3600*1000}
    }
    $timer.Interval = $waittime
    $timer.Start()
    $formReminder.Hide()
}

$handler_formReminder_Load= 
{
    $comboDelay.SelectedIndex = 0
}

$handler_timerTick = {
    $timer.Stop()
    $formReminder.ShowDialog()
}

$handler_pbIcon_Paint= 
{
    [System.Drawing.Graphics]$g = $_.Graphics
    $g.DrawImage([System.Drawing.Icon]::ExtractAssociatedIcon("$($env:SystemRoot)\System32\shdocvw.dll").ToBitmap(),0,0)  
}

$OnLoadForm_StateCorrection=
{#Correct the initial state of the form to prevent the .Net maximized form issue
	$formReminder.WindowState = $InitialFormWindowState
}

#----------------------------------------------


#region Generated Form Code
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 195
$System_Drawing_Size.Width = 382
$formReminder.ClientSize = $System_Drawing_Size
$formReminder.ControlBox = $false
$formReminder.DataBindings.DefaultDataSourceUpdateMode = 0
$formReminder.FormBorderStyle = 3
$formReminder.ShowInTaskbar = $false
$formReminder.MaximizeBox = $false
$formReminder.MinimizeBox = $false
$formReminder.Name = "formReminder"  
$formReminder.Text = "Update Erinnerung"  
$formReminder.TopMost = $true
$formReminder.SizeGripStyle = 2
$formReminder.add_Load($handler_formReminder_Load)
$formReminder.StartPosition = 0
$formReminder.Left = [int]([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width - $formReminder.Width)
$formReminder.Top = [int]([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height - ($formReminder.Height + 30))

$timer.Enabled = $false
$timer.Interval = 60000
$timer.add_tick($handler_timerTick)

$pbIcon.DataBindings.DefaultDataSourceUpdateMode = 0
$pbIcon.BackColor = [System.Drawing.Color]::FromArgb(255,253,202,65)
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 10
$System_Drawing_Point.Y = 7
$pbIcon.Location = $System_Drawing_Point
$pbIcon.Name = "pbIcon"  
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 32
$System_Drawing_Size.Width = 32
$pbIcon.Size = $System_Drawing_Size
$pbIcon.TabIndex = 6
$pbIcon.TabStop = $False
$pbIcon.add_Paint($handler_pbIcon_Paint)
$formReminder.Controls.Add($pbIcon)


$lblTitle.BackColor = [System.Drawing.Color]::FromArgb(255,253,202,65)
$lblTitle.DataBindings.DefaultDataSourceUpdateMode = 0
$lblTitle.Font = New-Object System.Drawing.Font("Calibri",15.75,1,3,0)  

$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 0
$System_Drawing_Point.Y = 0
$lblTitle.Location = $System_Drawing_Point
$lblTitle.Name = "lblTitle"  
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 45
$System_Drawing_Size.Width = 392
$lblTitle.Size = $System_Drawing_Size
$lblTitle.TabIndex = 5
$lblTitle.Text = "           Update Erinnerung"  
$lblTitle.TextAlign = 16

$formReminder.Controls.Add($lblTitle)

$comboDelay.DataBindings.DefaultDataSourceUpdateMode = 0
$comboDelay.FormattingEnabled = $True
$comboDelay.DropDownStyle = 2
$comboDelay.Items.Add("10 Minuten")|Out-Null  
$comboDelay.Items.Add("30 Minuten")|Out-Null  
$comboDelay.Items.Add("1 Stunde")|Out-Null  
$comboDelay.Items.Add("2 Stunden")|Out-Null  
$comboDelay.Items.Add("4 Stunden")|Out-Null  
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 273
$System_Drawing_Point.Y = 105
$comboDelay.Location = $System_Drawing_Point
$comboDelay.Name = "comboDelay"  
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 21
$System_Drawing_Size.Width = 97
$comboDelay.Size = $System_Drawing_Size
$comboDelay.TabIndex = 4

$formReminder.Controls.Add($comboDelay)

$label2.DataBindings.DefaultDataSourceUpdateMode = 0
$label2.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",9,0,3,0)  

$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 156
$System_Drawing_Point.Y = 106
$label2.Location = $System_Drawing_Point
$label2.Name = "label2"  
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 23
$System_Drawing_Size.Width = 111
$label2.Size = $System_Drawing_Size
$label2.TabIndex = 3
$label2.Text = "Erneut erinnern in"  

$formReminder.Controls.Add($label2)


$btnDelay.DataBindings.DefaultDataSourceUpdateMode = 0

$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 273
$System_Drawing_Point.Y = 138
$btnDelay.Location = $System_Drawing_Point
$btnDelay.Name = "btnDelay"  
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 23
$System_Drawing_Size.Width = 97
$btnDelay.Size = $System_Drawing_Size
$btnDelay.TabIndex = 2
$btnDelay.Text = "&Später"  
$btnDelay.UseVisualStyleBackColor = $True
$btnDelay.add_Click($handler_btnDelay_Click)

$formReminder.Controls.Add($btnDelay)


$btnReboot.DataBindings.DefaultDataSourceUpdateMode = 0

$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 173
$System_Drawing_Point.Y = 138
$btnReboot.Location = $System_Drawing_Point
$btnReboot.Name = "btnReboot"  
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 23
$System_Drawing_Size.Width = 94
$btnReboot.Size = $System_Drawing_Size
$btnReboot.TabIndex = 1
$btnReboot.Text = "&Neustart"  
$btnReboot.UseVisualStyleBackColor = $True
$btnReboot.add_Click($handler_btnReboot_Click)

$formReminder.Controls.Add($btnReboot)

$label1.DataBindings.DefaultDataSourceUpdateMode = 0
$label1.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",9,0,3,0)  

$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 30
$System_Drawing_Point.Y = 51
$label1.Location = $System_Drawing_Point
$label1.Name = "label1"  
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 51
$System_Drawing_Size.Width = 340
$label1.Size = $System_Drawing_Size
$label1.TabIndex = 0
$label1.Text = "Windows kann Dateien und Dienste nicht aktualisieren solange sie benutzt werden. Stellen sich sicher das sie Ihre Arbeit speichern bevor sie neu starten."  
$formReminder.Controls.Add($label1)

#endregion Generated Form Code

#Save the initial state of the form
$InitialFormWindowState = $formReminder.WindowState
#Init the OnLoad event to correct the initial state of the form
$formReminder.add_Load($OnLoadForm_StateCorrection)

Hide-PowerShell
$formReminder.ShowDialog()
while($timer.Enabled){
    [System.Windows.Forms.Application]::DoEvents()
    sleep -Milliseconds 500
}
Grüße Uwe