7
7
#AutoIt3Wrapper_Res_Comment= https:// www.whynotwin11.org
8
8
#AutoIt3Wrapper_Res_CompanyName= Robert Maehl Software
9
9
#AutoIt3Wrapper_Res_Description= Detection Script to help identify why your PC isn' t Windows 11 Release Ready. Now Supporting Update Checks!
10
- #AutoIt3Wrapper_Res_Fileversion= 2.6.1.0
10
+ #AutoIt3Wrapper_Res_Fileversion= 2.6.1.1
11
11
#AutoIt3Wrapper_Res_ProductName= WhyNotWin11
12
- #AutoIt3Wrapper_Res_ProductVersion= 2.6.1.0
12
+ #AutoIt3Wrapper_Res_ProductVersion= 2.6.1.1
13
13
#AutoIt3Wrapper_Res_LegalCopyright= Robert Maehl, using LGPL 3 License
14
14
#AutoIt3Wrapper_Res_Language= 1033
15
15
#AutoIt3Wrapper_Res_requestedExecutionLevel= asInvoker
@@ -96,7 +96,8 @@ Func ProcessCMDLine()
96
96
Local $sDrive = Null
97
97
Local $bForce = False
98
98
Local $bSilent = False
99
- Local $aOutput [3 ] = [False , " " , " " ]
99
+ Local $aExtras [2 ] = [" " ," " ]
100
+ Local $aOutput [4 ] = [False , " " , " " , $aExtras ]
100
101
Local $iParams = $CmdLine [0 ]
101
102
102
103
If $aMUI [0 ] = Null Then
@@ -126,18 +127,19 @@ Func ProcessCMDLine()
126
127
MsgBox (0 , " Help and Flags" , _
127
128
" Checks PC for Windows 11 Release Compatibility" & @CRLF & _
128
129
@CRLF & _
129
- " WhyNotWin11 [/export FORMAT FILENAME] [/drive DRIVE: ] [/force] [/fuonly] [/silent] [/skip [check]] [/update [branch ]]" & @CRLF & _
130
+ " WhyNotWin11 [/drive DRIVE:] [/ export FORMAT [ FILENAME]] [/extras DATA ] [/force] [/fuonly] [/silent] [/skip CHECK] [/update [BUILD ]]" & @CRLF & _
130
131
@CRLF & _
131
- @TAB & " /export" & @TAB & " Export Results in an Available format, can be used" & @CRLF & _
132
+ @TAB & " /drive " & @TAB & " Overrides which Disk Drive to run checks on." & @CRLF & _
133
+ @TAB & " /export" & @TAB & " Export Results in CSV, TSV, or TXT, can be used" & @CRLF & _
132
134
@TAB & " " & @TAB & " without the /silent flag for both GUI and file" & @CRLF & _
133
- @TAB & " " & @TAB & " output. Requires a filename if used ." & @CRLF & _
134
- @TAB & " formats " & @TAB & " TXT, CSV " & @CRLF & _
135
+ @TAB & " " & @TAB & " output. Defaults to HOSTNAME if no filename set ." & @CRLF & _
136
+ @TAB & " /extras " & @TAB & " Extra data to output when using /export (See Wiki. " & @CRLF & _
135
137
@TAB & " /force " & @TAB & " Ignores program system requirements (e.g. WinPE)" & @CRLF & _
136
138
@TAB & " /fuonly" & @TAB & " Checks Win11 Feature Update compatibility" & @CRLF & _
137
139
@TAB & " /silent" & @TAB & " Don't Display the GUI. Compatible Systems will Exit" & @CRLF & _
138
140
@TAB & " " & @TAB & " with ERROR_SUCCESS." & @CRLF & _
139
- @TAB & " /skip " & @TAB & " Skips a Comma Separated List of Checks (see Wiki)" & @CRLF & _
140
- @TAB & " /update" & @TAB & " Downloads the latest RELEASE (default) or DEV build" & @CRLF & _
141
+ @TAB & " /skip " & @TAB & " Skips a Comma Separated List of Checks (see Wiki). " & @CRLF & _
142
+ @TAB & " /update" & @TAB & " Downloads the latest RELEASE (default) or DEV build. " & @CRLF & _
141
143
@CRLF & _
142
144
" Refer to https://WhyNotWin11.org/wiki/Command-Line-Switches for more details" & @CRLF )
143
145
Exit 0
@@ -156,24 +158,70 @@ Func ProcessCMDLine()
156
158
EndSelect
157
159
Case " /e" , " /export" , " /format"
158
160
Select
159
- Case UBound ($CmdLine ) < = 3
160
- MsgBox (0 , " Invalid" , " Missing FILENAME parameter for /format." & @CRLF )
161
- Exit 87 ; ERROR_INVALID_PARAMETER
162
161
Case UBound ($CmdLine ) < = 2
163
162
MsgBox (0 , " Invalid" , " Missing FORMAT parameter for /format." & @CRLF )
164
163
Exit 87 ; ERROR_INVALID_PARAMETER
165
164
Case Else
166
165
Switch $CmdLine [2 ]
167
- Case " CSV" , " TXT"
166
+ Case " CSV" , " TSV " , " TXT"
168
167
$aOutput [0 ] = True
169
168
$aOutput [1 ] = $CmdLine [2 ]
170
- $aOutput [2 ] = $CmdLine [3 ]
171
- _ArrayDelete($CmdLine , " 1-3" )
169
+ Select
170
+ Case UBound ($CmdLine ) < = 3
171
+ ContinueCase
172
+ Case StringLeft ($CmdLine [3 ], 1 ) = " /"
173
+ $aOutput [2 ] = @ComputerName & " ." & $CmdLine [2 ]
174
+ _ArrayDelete($CmdLine , " 1-2" )
175
+ Case Else
176
+ $aOutput [2 ] = $CmdLine [3 ]
177
+ If StringInStr (FileGetAttrib ($CmdLine [3 ]), " D" ) Then
178
+ If Not StringRight ($CmdLine [3 ], 1 ) <> " \" Then $aOutput [2 ] &= " \"
179
+ $aOutput [2 ] &= @ComputerName & " ." & $CmdLine [2 ]
180
+ EndIf
181
+ _ArrayDelete($CmdLine , " 1-3" )
182
+ EndSelect
172
183
Case Else
173
184
MsgBox (0 , " Invalid" , " Invalid FORMAT parameter for /format." & @CRLF )
174
185
Exit 87 ; ERROR_INVALID_PARAMETER
175
186
EndSwitch
176
187
EndSelect
188
+ Case " /ex" , " /extras"
189
+ Select
190
+ Case UBound ($CmdLine ) < = 2
191
+ MsgBox (0 , " Invalid" , " Missing DATA parameter for /extras." & @CRLF )
192
+ Exit 87 ; ERROR_INVALID_PARAMETER
193
+ Case Else
194
+ $aTemp = StringSplit ($CmdLine [2 ], " ," , $STR_NOCOUNT )
195
+ For $iLoop = 0 To UBound ($aTemp ) - 1
196
+ Switch $aTemp [$iLoop ]
197
+ Case " BUILD"
198
+ $aExtras [0 ] &= " ,OS Build"
199
+ $aExtras [1 ] &= " ," & @OSBuild
200
+ Case " KEYBOARD"
201
+ $aExtras [0 ] &= " ,Keyboard Langauage"
202
+ $aExtras [1 ] &= " ," & @KBLayout
203
+ Case " LANGUAGE"
204
+ $aExtras [0 ] &= " ,OS Langauage"
205
+ $aExtras [1 ] &= " ," & @OSLang
206
+ Case " MUI"
207
+ $aExtras [0 ] &= " ,MUI Langauage"
208
+ $aExtras [1 ] &= " ," & @MUILang
209
+ Case " OS"
210
+ $aExtras [0 ] &= " ,Operating System"
211
+ $aExtras [1 ] &= " ," & @OSVersion
212
+ Case " USER"
213
+ $aExtras [0 ] &= " ,Logged In User"
214
+ $aExtras [1 ] &= " ," & @UserName
215
+ Case Else
216
+ MsgBox (0 , " Invalid" , " Invalid DATA parameter for /extras." & @CRLF )
217
+ Exit 87 ; ERROR_INVALID_PARAMETER
218
+ EndSwitch
219
+ Next
220
+ $aExtras [0 ] = StringTrimLeft ($aExtras [0 ], 1 )
221
+ $aExtras [1 ] = StringTrimLeft ($aExtras [1 ], 1 )
222
+ $aOutput [3 ] = $aExtras
223
+ _ArrayDelete($CmdLine , " 1-2" )
224
+ EndSelect
177
225
Case " /f" , " /force"
178
226
$bForce = True
179
227
_ArrayDelete($CmdLine , 1 )
@@ -339,7 +387,7 @@ Func ProcessCMDLine()
339
387
EndIf
340
388
If $aOutput [0 ] = True Then OutputResults($aResults , $aSkips , $aOutput )
341
389
For $iLoop = 0 To 10 Step 1
342
- If $aResults [$iLoop ][0 ] = False Or $aResults [$iLoop ][0 ] < 1 Then Exit 1
390
+ If ( $aResults [$iLoop ][0 ] = False Or $aResults [$iLoop ][0 ] < 1 ) And Not $aSkips [ $iLoop ] Then Exit 1
343
391
Next
344
392
Exit 0
345
393
EndFunc ; ==>ProcessCMDLine
@@ -1346,9 +1394,21 @@ EndFunc ;==>FinalizeResults
1346
1394
Func OutputResults(ByRef $aResults , ByRef $aSkips , $aOutput )
1347
1395
1348
1396
Local $sFile , $hFile , $sOut = " "
1397
+ Local $aExtras , $aExtraData
1349
1398
1350
1399
Local $aLabel [11 ] = [" Architecture" , " Boot Method" , " CPU Compatibility" , " CPU Core Count" , " CPU Frequency" , " DirectX + WDDM2" , " Disk Partition Type" , " RAM Installed" , " Secure Boot" , " Storage Available" , " TPM Version" ]
1351
1400
1401
+ $aExtras = $aOutput [3 ]
1402
+
1403
+ _ArrayAdd($aLabel , StringSplit ($aExtras [0 ], " ," , $STR_NOCOUNT ))
1404
+ $aExtraData = StringSplit ($aExtras [1 ], " ," , $STR_NOCOUNT )
1405
+
1406
+ If $aLabel [11 ] <> " " Then
1407
+ ; ;;
1408
+ Else
1409
+ _ArrayDelete($aLabel , 11 )
1410
+ EndIf
1411
+
1352
1412
Switch $aOutput [1 ]
1353
1413
Case " txt"
1354
1414
If StringInStr ($aOutput [2 ], " :" ) Or StringInStr ($aOutput [2 ], " \\" ) Then
@@ -1358,11 +1418,44 @@ Func OutputResults(ByRef $aResults, ByRef $aSkips, $aOutput)
1358
1418
EndIf
1359
1419
$hFile = FileOpen ($sFile , $FO_CREATEPATH + $FO_OVERWRITE )
1360
1420
$sOut = " Results for " & @ComputerName & @CRLF
1361
- For $iLoop = 0 To 10 Step 1
1362
- If $aSkips [ $ iLoop] Then
1363
- $sOut &= $aLabel [$iLoop ] & @TAB & True & @TAB & " Skipped " & @TAB & " Skipped " & @CRLF
1421
+ For $iLoop = 0 To UBound ( $aLabel ) - 1 Step 1
1422
+ If $iLoop > 10 Then
1423
+ $sOut &= $aLabel [$iLoop ] & " : " & $aExtraData [ $iLoop - 11 ] & @CRLF
1364
1424
Else
1365
- $sOut &= $aLabel [$iLoop ] & @TAB & $aResults [$iLoop ][0 ] & @TAB & $aResults [$iLoop ][1 ] & @TAB & $aResults [$iLoop ][2 ] & @CRLF
1425
+ If $aSkips [$iLoop ] Then
1426
+ $sOut &= $aLabel [$iLoop ] & @TAB & True & @TAB & " Skipped" & @TAB & " Skipped" & @CRLF
1427
+ Else
1428
+ $sOut &= $aLabel [$iLoop ] & @TAB & $aResults [$iLoop ][0 ] & @TAB & $aResults [$iLoop ][1 ] & @TAB & $aResults [$iLoop ][2 ] & @CRLF
1429
+ EndIf
1430
+ EndIf
1431
+ Next
1432
+
1433
+ Case " tsv"
1434
+ If StringInStr ($aOutput [2 ], " :" ) Or StringInStr ($aOutput [2 ], " \\" ) Then
1435
+ $sFile = $aOutput [2 ]
1436
+ Else
1437
+ $sFile = @ScriptDir & " \" & $aOutput [2 ]
1438
+ EndIf
1439
+ If Not FileExists ($sFile ) Then
1440
+ $hFile = FileOpen ($sFile , $FO_CREATEPATH + $FO_OVERWRITE )
1441
+ $sOut = " Hostname"
1442
+ For $iLoop = 0 To UBound ($aLabel ) - 1 Step 1
1443
+ $sOut &= @TAB & $aLabel [$iLoop ]
1444
+ Next
1445
+ FileWrite ($hFile , $sOut & @CRLF )
1446
+ Else
1447
+ $hFile = FileOpen ($sFile , $FO_APPEND )
1448
+ EndIf
1449
+ $sOut = @ComputerName
1450
+ For $iLoop = 0 To UBound ($aLabel ) - 1 Step 1
1451
+ If $iLoop > 10 Then
1452
+ $sOut &= @TAB & $aExtraData [$iLoop - 11 ]
1453
+ Else
1454
+ If $aSkips [$iLoop ] Then
1455
+ $sOut &= @TAB & True
1456
+ Else
1457
+ $sOut &= @TAB & $aResults [$iLoop ][0 ]
1458
+ EndIf
1366
1459
EndIf
1367
1460
Next
1368
1461
@@ -1374,20 +1467,24 @@ Func OutputResults(ByRef $aResults, ByRef $aSkips, $aOutput)
1374
1467
EndIf
1375
1468
If Not FileExists ($sFile ) Then
1376
1469
$hFile = FileOpen ($sFile , $FO_CREATEPATH + $FO_OVERWRITE )
1377
- $sOut = FileWrite ( $hFile , " Hostname" )
1378
- For $iLoop = 0 To 10 Step 1
1379
- $sOut &= FileWrite ( $hFile , " ," & $aLabel [$iLoop ])
1470
+ $sOut = " Hostname"
1471
+ For $iLoop = 0 To UBound ( $aLabel ) - 1 Step 1
1472
+ $sOut &= " ," & $aLabel [$iLoop ]
1380
1473
Next
1381
1474
FileWrite ($hFile , $sOut & @CRLF )
1382
1475
Else
1383
1476
$hFile = FileOpen ($sFile , $FO_APPEND )
1384
1477
EndIf
1385
1478
$sOut = @ComputerName
1386
- For $iLoop = 0 To 10 Step 1
1387
- If $aSkips [ $ iLoop] Then
1388
- $sOut &= FileWrite ( $hFile , " ," & True )
1479
+ For $iLoop = 0 To UBound ( $aLabel ) - 1 Step 1
1480
+ If $iLoop > 10 Then
1481
+ $sOut &= " ," & $aExtraData [ $iLoop - 11 ]
1389
1482
Else
1390
- $sOut &= FileWrite ($hFile , " ," & $aResults [$iLoop ][0 ])
1483
+ If $aSkips [$iLoop ] Then
1484
+ $sOut &= " ," & True
1485
+ Else
1486
+ $sOut &= " ," & $aResults [$iLoop ][0 ]
1487
+ EndIf
1391
1488
EndIf
1392
1489
Next
1393
1490
0 commit comments