require wodim
scan optical devices
wodim -scanbuswodim --devices
e.g.
| # coding: utf8 | |
| xml = '''<?xml version="1.0" encoding="UTF-8"?> | |
| <soft> | |
| <os> | |
| <item name="linux" dist="ubuntu"> | |
| This text about linux | |
| </item> | |
| <item name="mac os"> | |
| Apple company |
| #include <stdio.h> | |
| #include <Windows.h> | |
| struct Name | |
| { | |
| char FirstName[100]; | |
| char LastName[100]; | |
| char *Array[3]; | |
| }; |
| #!/bin/sh | |
| base=$1 | |
| convert "$base" -resize '29x29' -unsharp 1x4 "Icon-Small.png" | |
| convert "$base" -resize '40x40' -unsharp 1x4 "Icon-Small-40.png" | |
| convert "$base" -resize '50x50' -unsharp 1x4 "Icon-Small-50.png" | |
| convert "$base" -resize '57x57' -unsharp 1x4 "Icon.png" | |
| convert "$base" -resize '58x58' -unsharp 1x4 "[email protected]" | |
| convert "$base" -resize '60x60' -unsharp 1x4 "Icon-60.png" | |
| convert "$base" -resize '72x72' -unsharp 1x4 "Icon-72.png" | |
| convert "$base" -resize '76x76' -unsharp 1x4 "Icon-76.png" |
| internal static class NativeMethods { | |
| public static void PreventSleep() { | |
| SetThreadExecutionState(ExecutionState.EsContinuous | ExecutionState.EsSystemRequired); | |
| } | |
| public static void AllowSleep() { | |
| SetThreadExecutionState(ExecutionState.EsContinuous); | |
| } |
| # Get-EvengLog doesn't quite work I guess: | |
| # https://stackoverflow.com/questions/31396903/get-eventlog-valid-message-missing-for-some-event-log-sources# | |
| # Get-EventLog Application -EntryType Error -Source "DistributedCOM" | |
| # The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID | |
| #$logs = Get-EventLog -LogName "System" -EntryType Error -Source "DCOM" -Newest 1 -Message "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID*" | |
| # 2 is error | |
| # 3 is warning | |
| $EVT_MSG = "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID" | |
| # Search for System event log ERROR entries starting with the specified EVT_MSG | |
| $logEntry = Get-WinEvent -FilterHashTable @{LogName='System'; Level=2} | Where-Object { $_.Message -like "$EVT_MSG*" } | Select-Object -First 1 |
Caution
Due to the subject of this Gist there are a lot of spam/scam comments. I try to remove them all as soon as possible. I don't recommend you to click on any link in the comments
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus
| ;based on https://nsis.sourceforge.io/PowerShell_support but with x64 support | |
| !include x64.nsh | |
| !ifndef PSEXEC_INCLUDED | |
| !define PSEXEC_INCLUDED | |
| !macro PowerShellExecMacro PSCommand | |
| InitPluginsDir | |
| ;Save command in a temp file | |
| Push $R1 | |
| FileOpen $R1 $PLUGINSDIR\tempfile.ps1 w |