PowerShell – Add Shortcut to Start Menu

email me

$objShell = New-Object -ComObject WScript.Shell
$explorerFile = "C:\Windows\explorer.exe"

$URL = "https://eddiejackson.net"

$webLink = $objShell.SpecialFolders("AllUsersPrograms") + "\Eddie_Site.lnk"
If (Test-Path $webLink){
Remove-Item $webLink
}

$objShortcut = $objShell.CreateShortcut($webLink)
$objShortcut.IconLocation = "explorer.exe,12"
$objShortcut.TargetPath = $explorerFile
$objShortcut.Arguments = $URL
$objShortcut.Save()

 

tags: MrNetTek

Google Chrome – 75.0.3770.90

email me

New Chrome browser is available here:

https://enterprise.google.com/intl/en_version/chrome/chrome-browser/ mirror

 

Size

56.4 MB


Silent Install

setup.msi /quiet /norestart


Silent Uninstall

msiexec /x{AD0D6C17-32A2-32A0-8FD0-CC8A13AA57B6} /qn /norestart


MSI Property Table

UpgradeCode                                {C1DFDF69-5945-32F2-A35E-EE94C99C7CF4}
AllowDowngradeSubstitution     false
ALLUSERS                                       1
ARPPRODUCTICON                       icon.ico
ARPNOMODIFY                             1
Manufacturer                                Google LLC
ProductCode                                 {AD0D6C17-32A2-32A0-8FD0-CC8A13AA57B6}
ProductLanguage                         1033
ProductName                                Google Chrome
ProductVersion                             67.174.32858
SecureCustomProperties            NEWPRODUCTFOUND;UPGRADEFOUND

 

Notes

Release Notes v75

Chrome Platform Status

Chrome All Features

Admin Insider: What’s new in Chrome Enterprise, Release v75

Chrome Scrubber

 

tags: MrNetTek

PowerShell – Run Cleanup Manager, Partially Automated

email me

$ErrorActionPreference= 'silentlycontinue'

# return before data
$SpaceBefore = (Get-WmiObject win32_logicaldisk -filter "DeviceID='C:'" | select Freespace).FreeSpace/1GB

# Agent 99, I mean StateFlags0099
if  (-not (get-itemproperty -path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active Setup Temp Folders' -name StateFlags0099 -ErrorAction SilentlyContinue)) {
set-itemproperty -path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active Setup Temp Folders' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\BranchCache' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded Program Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Internet Cache Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Memory Dump Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Old ChkDsk Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Previous Installations' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Service Pack Cleanup' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Setup Log Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error memory dump files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error minidump files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Setup Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Upgrade Discarded Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\User file versions' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Defender' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Archive Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Queue Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting System Archive Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting System Queue Files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows ESD installation files' -name StateFlags0099 -type DWORD -Value 2
set-itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Upgrade Log Files' -name StateFlags0099 -type DWORD -Value 2
}

# launch cleanmgr
cleanmgr /sagerun:99
$counter = "."

do {

clear-host
Write-Host "Cleanup started...please wait"
echo $counter
$counter = $counter + "."
Start-Sleep -Seconds 5

} while ((get-wmiobject win32_process | where-object {$_.processname -eq 'cleanmgr.exe'} | measure).count)

Clear-Host
Write-Host "Cleanup complete!`n"

# return after data
$SpaceAfter = (Get-WmiObject win32_logicaldisk -filter "DeviceID='C:'" | select Freespace).FreeSpace/1GB

# display HD cleanup info
"Free Space Before: {0}" -f $SpaceBefore
"Free Space After: {0}" -f $SpaceAfter

Write-Host "`n"


Notes

set rootkey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches
for /f “tokens=*” %%K in (‘reg query %rootkey%’) do >NUL REG add “%%K” /v StateFlags0099 /t REG_DWORD /d 2 /f
cleanmgr /sagerun:99

 

tags: MrNetTek

AutoIt – Run Disk Cleanup, Hide Manager and Notification Window

email me

Download and install AutoIt and AutoIt Editor.

Save code as hiddencleanmgr.au3 for testing. Afterwards, compile to EXE (x86) using AutoIt Editor.

#NoTrayIcon

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <TrayConstants.au3> 

Opt("TrayIconHide", 1)

; Command to run
$AppName = 'cleanmgr.exe /dc /verylowdisk'

; Window to hide
$ParentWindow = GUICreate('Disk Cleanup', 0, 0, 0, 0, 0, $WS_EX_TOOLWINDOW)

; New---hidden window----this will contain the cleanmgr operation
$ChildWindow = GUICreate("WindowTitle", 0, 0, -100, -100, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), BitOR($WS_EX_DLGMODALFRAME, $WS_EX_TOPMOST), $ParentWindow)

;Sets status of new window
;if this is hidden, you won't be 
;able to hide/control child window
GUISetState(@SW_SHOW)

$ProcPID = Run($AppName,"",@SW_HIDE)
Sleep(2000)
WinWaitActive("Disk Cleanup")


While ProcessExists($ProcPID) = 0
    Sleep(100)
WEnd

;Returns Title by PID - required for Handle
$WindowTitle = _WinGetByPID($ProcPID,1)

;Wait for child to appear
WinWaitActive($WindowTitle)

;Returns handle for child
$ChildHandle = WinGetHandle($WindowTitle)

;Adds child to new parent window
_SetParent($ChildHandle, $ChildWindow)

;Hide child or SW_SHOW child in parent window
WinSetState($ChildHandle, "", @SW_HIDE)
Sleep(2000)

; catch the Disk Space Notification Window
Global $i = 0
DO
Sleep(250)
If WinExists("Disk Space Notification") Then	   ; checks for Notifcation Window
	Run("taskkill /f /im cleanmgr.exe","",@SW_HIDE); cleanup manager process
	Run("taskkill /f /im autoit3.exe","",@SW_HIDE) ; script running uncompiled
	Run("taskkill /f /im hiddencleanmgr.exe","",@SW_HIDE); name of this compiled script
EndIf
$i = $i + 1
UNTIL $i > 9600; 40 minutes runtime


Do
Sleep(10)
Until GuiGetMsg() =-3


Exit

; Functions

Func _SetParent($id_child, $h_parent)	
    If Not IsHWnd($h_parent) Then $h_parent = HWnd($h_parent)
    If Not IsHWnd($id_child) Then $id_child = GUICtrlGetHandle($id_child)
    If DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $id_child, "hwnd", $h_parent) <> 0 Then
        Return 1
    Else
        seterror(1)
        Return 0
    EndIf
EndFunc

Func _WinGetByPID($iPID, $iArray = 1) 	
    Local $aError[1] = [0], $aWinList, $sReturn
    If IsString($iPID) Then
        $iPID = ProcessExists($iPID)
    EndIf
    $aWinList = WinList()
    For $A = 1 To $aWinList[0][0]
        If WinGetProcess($aWinList[$A][1]) = $iPID And BitAND(WinGetState($aWinList[$A][1]), 2) Then
            If $iArray Then
                Return $aWinList[$A][1]
            EndIf
            $sReturn &= $aWinList[$A][1] & Chr(1)
        EndIf
    Next
    If $sReturn Then
        Return StringSplit(StringTrimRight($sReturn, 1), Chr(1))
    EndIf
    Return SetError(1, 0, $aError)
EndFunc   

 


Screenshot

Disk Cleanup Manager running with no window

 

Notes

PowerShell Cleanup

$HKLM = [UInt32] “0x80000002”
$strKeyPath = “SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches”
$strValueName = “StateFlags0065”

$subkeys = gci -Path HKLM:\$strKeyPath -Name
ForEach ($subkey in $subkeys) {
Try {
New-ItemProperty -Path HKLM:\$strKeyPath\$subkey -Name $strValueName -PropertyType DWord -Value 2 -ErrorAction SilentlyContinue| Out-Null
}
Catch {
}
try {
Start-Process cleanmgr -ArgumentList “/sagerun:65” -Wait -NoNewWindow -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
}
catch {
}
}
ForEach ($subkey in $subkeys) {
Try {
Remove-ItemProperty -Path HKLM:\$strKeyPath\$subkey -Name $strValueName | Out-Null
}
Catch {
}
}

 

tags: Automating disk cleanup, scripting computer  cleanup, MrNetTek

PowerShell – Turn Off Computer Screen

email me

function Turn-MonitorOff ()
{
[CmdletBinding()]
param()

$HWND = -1
$WM_SYSCOMMAND = 0x0112
$SC_MONITORPOWER = 0xF170
$MONITOR_ON = -1
$MONITOR_OFF = 2

#Store the C# signature of the SendMessage function.
$signature = '[DllImport("user32.dll")] public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);'

#Add the SendMessage function as a static method of a class
$SendMessage = Add-Type -MemberDefinition $signature -Name "Win32SendMessage" -Namespace Win32Functions -PassThru

#Invoke the SendMessage Function
$SendMessage::PostMessage($HWND, $WM_SYSCOMMAND, $SC_MONITORPOWER, $MONITOR_OFF) | Out-Null

}
Turn-MonitorOff

 

tags: MrNetTek

VLC Player – 3.07.1

email me

Download

A new VLC Player is available here:

https://get.videolan.org/vlc/3.0.7.1/win32/vlc-3.0.7.1-win32.exe


Size

38.8 MB


Silent Install

setup.exe /S /V/qn


Silent Uninstall

“C:\Program Files (x86)\VideoLAN\VLC\uninstall.exe”  /S /V/qn


Registry

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\VLC media player


Notes

https://wiki.videolan.org/Documentation:Documentation

/L=1033 – Set language to English

/S – Install silently

/NCRC – Skip CRC Check

 

Use VLC as a Video Downloader for YouTube

1. Click on Media > Open Network stream.

2. Paste the YouTube URL and click the Play button in the player.

3. VLC Media Player starts streaming the video. Click Tools > Codec Information > at the bottom of the window you will see a Location box.

4. Copy the long URL in the box and paste this into your browser’s address bar. The browser will now start playing the video file. You can download the video file to your desktop by doing a Save video as with a right-click on the video.

 

tags: MrNetTek

Windows – Display/Monitor Timeout after 10 minutes

email me

powercfg -setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 600
powercfg -setactive SCHEME_CURRENT

or

powercfg -change -monitor-timeout-ac 10

 

Notes

On Battery

powercfg /SETDCVALUEINDEX SCHEME_CURRENT 7516b95f-f776-4464-8c53-06167f40cc99 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e 600

On AC
powercfg /SETACVALUEINDEX SCHEME_CURRENT 7516b95f-f776-4464-8c53-06167f40cc99 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e 600

Using 0 seconds is the same as “Never”

 

Disable sleep for everything

powercfg /x -hibernate-timeout-ac 0
powercfg /x -hibernate-timeout-dc 0
powercfg /x -disk-timeout-ac 0
powercfg /x -disk-timeout-dc 0
powercfg /x -monitor-timeout-ac 0
powercfg /x -monitor-timeout-dc 0
Powercfg /x -standby-timeout-ac 0
powercfg /x -standby-timeout-dc 0

 

Windows 10

command: powercfg -aliases

Output

a1841308-3541-4fab-bc81-f71556f20b4a SCHEME_MAX
8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c SCHEME_MIN
381b4222-f694-41f0-9685-ff5bb260df2e SCHEME_BALANCED
e73a048d-bf27-4f12-9731-8b2076e8891f SUB_BATTERY
637ea02f-bbcb-4015-8e2c-a1c7b9c0b546 BATACTIONCRIT
d8742dcb-3e6a-4b3c-b3fe-374623cdcf06 BATACTIONLOW
5dbb7c9f-38e9-40d2-9749-4f8a0e9f640f BATFLAGSCRIT
bcded951-187b-4d05-bccc-f7e51960c258 BATFLAGSLOW
9a66d8d7-4ff7-4ef9-b5a2-5a326ca2a469 BATLEVELCRIT
8183ba9a-e910-48da-8769-14ae6dc1170a BATLEVELLOW
4f971e89-eebd-4455-a8de-9e59040e7347 SUB_BUTTONS
5ca83367-6e45-459f-a27b-476b1d01c936 LIDACTION
7648efa3-dd9c-4e3e-b566-50f929386280 PBUTTONACTION
96996bc0-ad50-47ec-923b-6f41874dd9eb SBUTTONACTION
a7066653-8d6c-40a8-910e-a1f54b84c7e5 UIBUTTON_ACTION
0012ee47-9041-4b5d-9b77-535fba8b1442 SUB_DISK
6738e2c4-e8a5-4a42-b16a-e040e769756e DISKIDLE
5fb4938d-1ee8-4b0f-9a3c-5036b0ab995c SUB_GRAPHICS
48672f38-7a9a-4bb2-8bf8-3d85be19de4e SUB_INTSTEER
2e601130-5351-4d9d-8e04-252966bad054 SUB_IR
fea3413e-7e05-4911-9a71-700331f1c294 SUB_NONE
501a4d13-42af-4429-9fd1-a8218c268e20 SUB_PCIEXPRESS
ee12f906-d277-404b-b6da-e5fa1a576df5 ASPM
8619b916-e004-4dd8-9b66-dae86f806698 SUB_PRESENCE
54533251-82be-4824-96c1-47b60b740d00 SUB_PROCESSOR
bc5038f7-23e0-4960-96da-33abaf5935ec PROCTHROTTLEMAX
893dee8e-2bef-41e0-89c6-b55d0929964c PROCTHROTTLEMIN
94d3a615-a899-4ac5-ae2b-e4d8f634367f SYSCOOLPOL
238c9fa8-0aad-41ed-83f4-97be242c8f20 SUB_SLEEP
9d7815a6-7ee4-497e-8888-515a05f02364 HIBERNATEIDLE
94ac6d29-73ce-41a6-809f-6363ba21b47e HYBRIDSLEEP
bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d RTCWAKE
29f6c1db-86da-48c5-9fdb-f2b67b1f44da STANDBYIDLE
7516b95f-f776-4464-8c53-06167f40cc99 SUB_VIDEO
fbd9aa66-9553-4097-ba44-ed6e9d65eab8 ADAPTBRIGHT
3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e VIDEOIDLE

 

Power Profile Details

Power Scheme GUID: e26d8997-5311-49ea-acb9-03aad4d86f7d (meteo_t)
Subgroup GUID: fea3413e-7e05-4911-9a71-700331f1c294 (Settings belonging to no subgroup)
GUID Alias: SUB_NONE
Power Setting GUID: 0e796bdb-100d-47d6-a2d5-f7d2daa51f51 (Require a password on wakeup)
GUID Alias: CONSOLELOCK
Possible Setting Index: 000
Possible Setting Friendly Name: No
Possible Setting Index: 001
Possible Setting Friendly Name: Yes
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Subgroup GUID: 0012ee47-9041-4b5d-9b77-535fba8b1442 (Hard disk)
GUID Alias: SUB_DISK
Power Setting GUID: 6738e2c4-e8a5-4a42-b16a-e040e769756e (Turn off hard disk after)
GUID Alias: DISKIDLE
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x0000001e
Current DC Power Setting Index: 0x0000001e

Subgroup GUID: 02f815b5-a5cf-4c84-bf20-649d1f75d3d8 (Internet Explorer)
Power Setting GUID: 4c793e7d-a264-42e1-87d3-7a0d2f523ccd (JavaScript Timer Frequency)
Possible Setting Index: 000
Possible Setting Friendly Name: Maximum Power Savings
Possible Setting Index: 001
Possible Setting Friendly Name: Maximum Performance
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000000

Subgroup GUID: 0d7dbae2-4294-402a-ba8e-26777e8488cd (Desktop background settings)
Power Setting GUID: 309dce9b-bef4-4119-9921-a851fb12f0f4 (Slide show)
Possible Setting Index: 000
Possible Setting Friendly Name: Available
Possible Setting Index: 001
Possible Setting Friendly Name: Paused
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000001

Subgroup GUID: 19cbb8fa-5279-450e-9fac-8a3d5fedd0c1 (Wireless Adapter Settings)
Power Setting GUID: 12bbebe6-58d6-4636-95bb-3217ef867c1a (Power Saving Mode)
Possible Setting Index: 000
Possible Setting Friendly Name: Maximum Performance
Possible Setting Index: 001
Possible Setting Friendly Name: Low Power Saving
Possible Setting Index: 002
Possible Setting Friendly Name: Medium Power Saving
Possible Setting Index: 003
Possible Setting Friendly Name: Maximum Power Saving
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000002

Subgroup GUID: 238c9fa8-0aad-41ed-83f4-97be242c8f20 (Sleep)
GUID Alias: SUB_SLEEP
Power Setting GUID: 29f6c1db-86da-48c5-9fdb-f2b67b1f44da (Sleep after)
GUID Alias: STANDBYIDLE
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x000000b4
Current DC Power Setting Index: 0x00000384

Power Setting GUID: 94ac6d29-73ce-41a6-809f-6363ba21b47e (Allow hybrid sleep)
GUID Alias: HYBRIDSLEEP
Possible Setting Index: 000
Possible Setting Friendly Name: Off
Possible Setting Index: 001
Possible Setting Friendly Name: On
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000001

Power Setting GUID: 9d7815a6-7ee4-497e-8888-515a05f02364 (Hibernate after)
GUID Alias: HIBERNATEIDLE
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Power Setting GUID: bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d (Allow wake timers)
GUID Alias: RTCWAKE
Possible Setting Index: 000
Possible Setting Friendly Name: Disable
Possible Setting Index: 001
Possible Setting Friendly Name: Enable
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000000

Subgroup GUID: 2a737441-1930-4402-8d77-b2bebba308a3 (USB settings)
Power Setting GUID: 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 (USB selective suspend setting)
Possible Setting Index: 000
Possible Setting Friendly Name: Disabled
Possible Setting Index: 001
Possible Setting Friendly Name: Enabled
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000001

Subgroup GUID: 2e601130-5351-4d9d-8e04-252966bad054 (Idle Resiliency)
GUID Alias: SUB_IR
Subgroup GUID: 48df9d60-4f68-11dc-8314-0800200c9a66 (Intel(R) Dynamic Platform & Thermal Framework Settings)
Power Setting GUID: 07029cd8-4664-4698-95d8-43b2e9666596 (Config TDP Level)
Possible Setting Index: 000
Possible Setting Friendly Name: High TDP
Possible Setting Index: 001
Possible Setting Friendly Name: Nominal TDP
Possible Setting Index: 002
Possible Setting Friendly Name: Low TDP
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Power Setting GUID: 4a44b800-4f72-11dc-8314-0800200c9a66 (Power Limit)
Minimum Possible Setting: 0x00000001
Maximum Possible Setting: 0x00000005
Possible Settings increment: 0x00000001
Possible Settings units: Level
Current AC Power Setting Index: 0x00000003
Current DC Power Setting Index: 0x00000003

Power Setting GUID: 63c39116-4f72-11dc-8314-0800200c9a66 (Acoustics Limit)
Minimum Possible Setting: 0x00000001
Maximum Possible Setting: 0x00000005
Possible Settings increment: 0x00000001
Possible Settings units: Level
Current AC Power Setting Index: 0x00000003
Current DC Power Setting Index: 0x00000003

Power Setting GUID: b29c73e0-1a8b-46fd-b4ae-1ce5a3d6d871 (Low Power Mode Setting)
Possible Setting Index: 000
Possible Setting Friendly Name: Disable
Possible Setting Index: 001
Possible Setting Friendly Name: Enable
Possible Setting Index: 002
Possible Setting Friendly Name: Application Specific
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Subgroup GUID: 4f971e89-eebd-4455-a8de-9e59040e7347 (Power buttons and lid)
GUID Alias: SUB_BUTTONS
Power Setting GUID: 5ca83367-6e45-459f-a27b-476b1d01c936 (Lid close action)
GUID Alias: LIDACTION
Possible Setting Index: 000
Possible Setting Friendly Name: Do nothing
Possible Setting Index: 001
Possible Setting Friendly Name: Sleep
Possible Setting Index: 002
Possible Setting Friendly Name: Hibernate
Possible Setting Index: 003
Possible Setting Friendly Name: Shut down
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000001

Power Setting GUID: 7648efa3-dd9c-4e3e-b566-50f929386280 (Power button action)
GUID Alias: PBUTTONACTION
Possible Setting Index: 000
Possible Setting Friendly Name: Do nothing
Possible Setting Index: 001
Possible Setting Friendly Name: Sleep
Possible Setting Index: 002
Possible Setting Friendly Name: Hibernate
Possible Setting Index: 003
Possible Setting Friendly Name: Shut down
Current AC Power Setting Index: 0x00000003
Current DC Power Setting Index: 0x00000003

Power Setting GUID: 96996bc0-ad50-47ec-923b-6f41874dd9eb (Sleep button action)
GUID Alias: SBUTTONACTION
Possible Setting Index: 000
Possible Setting Friendly Name: Do nothing
Possible Setting Index: 001
Possible Setting Friendly Name: Sleep
Possible Setting Index: 002
Possible Setting Friendly Name: Hibernate
Possible Setting Index: 003
Possible Setting Friendly Name: Shut down
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000001

Power Setting GUID: a7066653-8d6c-40a8-910e-a1f54b84c7e5 (Start menu power button)
GUID Alias: UIBUTTON_ACTION
Possible Setting Index: 000
Possible Setting Friendly Name: Sleep
Possible Setting Index: 001
Possible Setting Friendly Name: Hibernate
Possible Setting Index: 002
Possible Setting Friendly Name: Shut down
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Subgroup GUID: 501a4d13-42af-4429-9fd1-a8218c268e20 (PCI Express)
GUID Alias: SUB_PCIEXPRESS
Power Setting GUID: ee12f906-d277-404b-b6da-e5fa1a576df5 (Link State Power Management)
GUID Alias: ASPM
Possible Setting Index: 000
Possible Setting Friendly Name: Off
Possible Setting Index: 001
Possible Setting Friendly Name: Moderate power savings
Possible Setting Index: 002
Possible Setting Friendly Name: Maximum power savings
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000002

Subgroup GUID: 54533251-82be-4824-96c1-47b60b740d00 (Processor power management)
GUID Alias: SUB_PROCESSOR
Power Setting GUID: 893dee8e-2bef-41e0-89c6-b55d0929964c (Minimum processor state)
GUID Alias: PROCTHROTTLEMIN
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0x00000064
Possible Settings increment: 0x00000001
Possible Settings units: %
Current AC Power Setting Index: 0x00000014
Current DC Power Setting Index: 0x00000014

Power Setting GUID: 94d3a615-a899-4ac5-ae2b-e4d8f634367f (System cooling policy)
GUID Alias: SYSCOOLPOL
Possible Setting Index: 000
Possible Setting Friendly Name: Passive
Possible Setting Index: 001
Possible Setting Friendly Name: Active
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000000

Power Setting GUID: bc5038f7-23e0-4960-96da-33abaf5935ec (Maximum processor state)
GUID Alias: PROCTHROTTLEMAX
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0x00000064
Possible Settings increment: 0x00000001
Possible Settings units: %
Current AC Power Setting Index: 0x00000064
Current DC Power Setting Index: 0x00000064

Subgroup GUID: 7516b95f-f776-4464-8c53-06167f40cc99 (Display)
GUID Alias: SUB_VIDEO
Power Setting GUID: 17aaa29b-8b43-4b94-aafe-35f64daaf1ee (Dim display after)
GUID Alias: VIDEODIM
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x00000078
Current DC Power Setting Index: 0x00000078

Power Setting GUID: 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e (Turn off display after)
GUID Alias: VIDEOIDLE
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Power Setting GUID: 8ec4b3a5-6868-48c2-be75-4f3044be88a7 (Console lock display off timeout)
GUID Alias: VIDEOCONLOCK
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x0000003c
Current DC Power Setting Index: 0x0000001e

Power Setting GUID: aded5e82-b909-4619-9949-f5d71dac0bcb (Display brightness)
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0x00000064
Possible Settings increment: 0x00000001
Possible Settings units: %
Current AC Power Setting Index: 0x0000003c
Current DC Power Setting Index: 0x00000028

Power Setting GUID: f1fbfde2-a960-4165-9f88-50667911ce96 (Dimmed display brightness)
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0x00000064
Possible Settings increment: 0x00000001
Possible Settings units: %
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000001

Power Setting GUID: fbd9aa66-9553-4097-ba44-ed6e9d65eab8 (Enable adaptive brightness)
GUID Alias: ADAPTBRIGHT
Possible Setting Index: 000
Possible Setting Friendly Name: Off
Possible Setting Index: 001
Possible Setting Friendly Name: On
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Subgroup GUID: 8619b916-e004-4dd8-9b66-dae86f806698 (Presence Aware Power Behavior)
GUID Alias: SUB_PRESENCE
Subgroup GUID: 9596fb26-9850-41fd-ac3e-f7c3c00afd4b (Multimedia settings)
Power Setting GUID: 03680956-93bc-4294-bba6-4e0f09bb717f (When sharing media)
Possible Setting Index: 000
Possible Setting Friendly Name: Allow the computer to sleep
Possible Setting Index: 001
Possible Setting Friendly Name: Prevent idling to sleep
Possible Setting Index: 002
Possible Setting Friendly Name: Allow the computer to enter Away Mode
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000000

Power Setting GUID: 34c7b99f-9a6d-4b3c-8dc7-b6693b78cef4 (When playing video)
Possible Setting Index: 000
Possible Setting Friendly Name: Optimize video quality
Possible Setting Index: 001
Possible Setting Friendly Name: Balanced
Possible Setting Index: 002
Possible Setting Friendly Name: Optimize power savings
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000001

Subgroup GUID: e73a048d-bf27-4f12-9731-8b2076e8891f (Battery)
GUID Alias: SUB_BATTERY
Power Setting GUID: 637ea02f-bbcb-4015-8e2c-a1c7b9c0b546 (Critical battery action)
GUID Alias: BATACTIONCRIT
Possible Setting Index: 000
Possible Setting Friendly Name: Do nothing
Possible Setting Index: 001
Possible Setting Friendly Name: Sleep
Possible Setting Index: 002
Possible Setting Friendly Name: Hibernate
Possible Setting Index: 003
Possible Setting Friendly Name: Shut down
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000002

Power Setting GUID: 8183ba9a-e910-48da-8769-14ae6dc1170a (Low battery level)
GUID Alias: BATLEVELLOW
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0x00000064
Possible Settings increment: 0x00000001
Possible Settings units: %
Current AC Power Setting Index: 0x00000006
Current DC Power Setting Index: 0x00000006

Power Setting GUID: 9a66d8d7-4ff7-4ef9-b5a2-5a326ca2a469 (Critical battery level)
GUID Alias: BATLEVELCRIT
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0x00000064
Possible Settings increment: 0x00000001
Possible Settings units: %
Current AC Power Setting Index: 0x00000002
Current DC Power Setting Index: 0x00000002

Power Setting GUID: bcded951-187b-4d05-bccc-f7e51960c258 (Low battery notification)
GUID Alias: BATFLAGSLOW
Possible Setting Index: 000
Possible Setting Friendly Name: Off
Possible Setting Index: 001
Possible Setting Friendly Name: On
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000001

Power Setting GUID: d8742dcb-3e6a-4b3c-b3fe-374623cdcf06 (Low battery action)
GUID Alias: BATACTIONLOW
Possible Setting Index: 000
Possible Setting Friendly Name: Do nothing
Possible Setting Index: 001
Possible Setting Friendly Name: Sleep
Possible Setting Index: 002
Possible Setting Friendly Name: Hibernate
Possible Setting Index: 003
Possible Setting Friendly Name: Shut down
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Power Setting GUID: f3c5027d-cd16-4930-aa6b-90db844a8f00 (Reserve battery level)
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0x00000064
Possible Settings increment: 0x00000001
Possible Settings units: %
Current AC Power Setting Index: 0x00000004
Current DC Power Setting Index: 0x00000004

 

tags: MrNetTek

PowerShell – Check VPN Connection, Present Splash, Install MSI

email me

Using PowerShell, this performs an upgrade to current VPN software (Pulse, in my case). It detects if user is on VPN, notifies them to disconnect, disconnects from VPN, and then upgrades the VPN software.


$VPNStatus = Get-WmiObject -Query "Select * from Win32_NetworkAdapter where (Name like '%Juniper%') and NetEnabled='True'"

$VPNStatus = [bool]$VPNStatus

$PackagePath = $MyInvocation.MyCommand.Path

$dir = Split-Path $PackagePath

#$dir = "C:\SpecificPath"

$ErrorActionPreference= 'silentlycontinue'

clear-host

if ($VPNStatus) {

# timer for splash
Start-Process "$dir\TimerX.exe"

# kill existing process
Stop-Process -Name "mshta" -Force
Start-Sleep -s 2

# launch splash - wait for user to close splash
Start-Process "$dir\splash.hta" -Wait

# terminate VPN
Stop-Process -Name "Pulse" -Force
Stop-Process -Name "PulseSecureService" -Force

# launch animation
Start-Process "$dir\animation.hta"

# begin install - install with shared install enabled
Start-Process $dir\Install.exe -ArgumentList "/I $dir\setup64.msi /qn"
Start-Sleep -s 10

# wait for install to complete
Get-Process -Name Install -ErrorAction SilentlyContinue | Wait-Process

# helper process populates Pulse app with connections
Start-Process "C:\Program Files (x86)\Pulse Secure\Pulse\PulseHelper.exe"

# kill splash timer
Stop-Process -Name "timer" -Force

[Environment]::Exit(0)

}

else {

# no splash
# begin install - install with shared install enabled
Start-Process $dir\Install.exe -ArgumentList "/I $dir\setup64.msi /qn"

# wait for install to complete
Get-Process -Name Install -ErrorAction SilentlyContinue | Wait-Process

[Environment]::Exit(0)
}

[Environment]::Exit(1)


Notes

Install.exe = msiexec.exe. I copy and use it in the package to differentiate the MSI installer in task manager, and other monitoring utilities. I normally do the same for mshta.exe as well.

For Shared Install, see Pulse Disconnecting Users – Shared Install

 

tags: MrNetTek

Batch – Return True if Part of IP Address is Found

email me

This returns TRUE if a specified portion of the IP address is found.

Batch Command

For /f “tokens=*” %%a in (‘netsh interface ip show addresses ^| find “192.168.44”‘) do echo TRUE

 

Notes

PS C:\Windows\system32> netsh
netsh>/?

The following commands are available:

Commands in this context:
..            - Goes up one context level.
?             - Displays a list of commands.
abort         - Discards changes made while in offline mode.
add           - Adds a configuration entry to a list of entries.
advfirewall   - Changes to the `netsh advfirewall' context.
alias         - Adds an alias.
branchcache   - Changes to the `netsh branchcache' context.
bridge        - Changes to the `netsh bridge' context.
bye           - Exits the program.
commit        - Commits changes made while in offline mode.
delete        - Deletes a configuration entry from a list of entries.
dhcpclient    - Changes to the `netsh dhcpclient' context.
dnsclient     - Changes to the `netsh dnsclient' context.
dump          - Displays a configuration script.
exec          - Runs a script file.
exit          - Exits the program.
firewall      - Changes to the `netsh firewall' context.
help          - Displays a list of commands.
http          - Changes to the `netsh http' context.
interface     - Changes to the `netsh interface' context.
ipsec         - Changes to the `netsh ipsec' context.
ipsecdosprotection - Changes to the `netsh ipsecdosprotection' context.
lan           - Changes to the `netsh lan' context.
namespace     - Changes to the `netsh namespace' context.
netio         - Changes to the `netsh netio' context.
offline       - Sets the current mode to offline.
online        - Sets the current mode to online.
popd          - Pops a context from the stack.
pushd         - Pushes current context on stack.
quit          - Exits the program.
ras           - Changes to the `netsh ras' context.
rpc           - Changes to the `netsh rpc' context.
set           - Updates configuration settings.
show          - Displays information.
trace         - Changes to the `netsh trace' context.
unalias       - Deletes an alias.
wfp           - Changes to the `netsh wfp' context.
winhttp       - Changes to the `netsh winhttp' context.
winsock       - Changes to the `netsh winsock' context.

The following sub-contexts are available:
 advfirewall branchcache bridge dhcpclient dnsclient firewall http interface ipsec ipsecdosprotection lan namespace netio ras rpc trace wfp winhttp winsock

To view help for a command, type the command, followed by a space, and then type ?.

 

tags: MrNetTek

Adobe Creative Cloud – 4.8.2.478

email me

New Creative Cloud app is available here:

http://ccmdl.adobe.com/AdobeProducts/KCCC/1/win32/ACCCx4_8_2_478.zip

 

Some things to note:

  • Adobe has changed how enterprise installs are done, opting to move app control and app updates to the cloud. I’m guessing this is to reduce piracy, while enforcing updates.
  • The app set-up.exe (from the direct download) will work, however it is no longer 100% silent, and cannot be completely automated. {Adobe, say it ain’t so…}
  • For a fully automated enterprise deployment, you need to log into Adobe, and access the Cloud Admin Console. Appropriate rights are required to view the Admin Console. From there, you can create a downloadable, enterprise deployment package.

 

Workaround

Rather than being forced to use the online Admin Console, which requires licensing and rights, try using the Build folder I captured, minus the latest app update.

  • Create a Build folder.
  • Download the Build.zip.
  • Extract contents of Build.zip to Build folder.
  • Download the latest desktop app from Adobe.
  • Extract contents of desktop app.
  • Rename set-up.exe to set-up.dat.
  • Copy contents of desktop app to Build > ASU.
  • Create your own package, calling the setup.exe. For my package, I used a self-extracting EXE in WinRar, pointing to the setup.exe.


Build.zip file


ASU folder


Self-extracting EXE


Prepare for awesomeness

* if you have any trouble, try removing the existing version of Creative Cloud


Reg Keys

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Creative Cloud

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EC633002-0BA2-4CCA-8F8D-656C6B866D51}


Explorer Paths

ACC
C:\Program Files (x86)\Adobe\Adobe Creative Cloud

ADC
C:\Program Files (x86)\Common Files\Adobe\Adobe Desktop Common\HDBox

AAM
C:\Program Files (x86)\Common Files\Adobe\AdobeApplicationManager

C:\Program Files (x86)\Adobe\Adobe Creative Cloud Experience

C:\Program Files (x86)\Common Files\Adobe\Creative Cloud Libraries

C:\Program Files (x86)\Common Files\Adobe\CoreSyncExtension

C:\Program Files (x86)\Common Files\Adobe\caps

C:\Program Files (x86)\Adobe\Adobe Sync

C:\Users\%username%\AppData\Local\VirtualStore\Program Files (x86)\Adobe\Adobe Creative Cloud

C:\Users\%username%\AppData\Local\Temp\CreativeCloud

 

 

L e g a c y   S u p p o r t

Silent Install

Use a set-up.exe from a previous version to get around the initial Cloud setup.

set-up.exe –silent –ADOBEINSTALLDIR=”C:\Program Files (x86)\Adobe\CreativeCloud” –INSTALLLANGUAGE=en_GB

 

Silent Uninstall

Found the silent option inside the EXE…

“C:\Program Files (x86)\Adobe\Adobe Creative Cloud\Utils\Creative Cloud Uninstaller.exe” -u

 

Screenshot

 

Notes

From Process Explorer

C:\Windows\syswow64\MsiExec.exe -Embedding 8CA0D06DE82285055992603F2CA34510

Set-up.dat –mode=silent –action=install –edtWorkFlow=1

“C:\Program Files (x86)\Common Files\Adobe\Adobe Desktop Common\HDBox\Setup.exe” –install=1 –driverXML=”C:\Users\%USERNAME%\AppData\Local\Temp\{9EE6ED3E-5FA4-4C75-AFB6-412CE44DC77D}\{8DEABD1C-DADA-4A45-BDC8-4FB0CDFAA034}” 

“C:\setup\Creative_Cloud.msi” /qn 

 

Check out the -pid parameter

https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html

 

tags: MrNetTek

VitalSource Bookshelf – 8.2.22.0 AppxBundle

email me

Download

I have uploaded the AppxBundle here (great for creating an offline installer or importing into SCCM):

https://eddiejackson.net/apps/bookshelf/VitalSourceTechnologiesIn.VitalSourceBookshelf_8.2.22.0_neutral___wasrd15zsyawm.AppxBundle

* I capture the filestream URL from the Windows Store. That’s how I can download the appx bundles. 

 

Contents of AppxBundle

AppxBlockMap.xml
AppxMetadata
AppxSignature.p7x
Bookshelf_8.2.22.0_language-ar.appx
Bookshelf_8.2.22.0_language-bg.appx
Bookshelf_8.2.22.0_language-ca.appx
Bookshelf_8.2.22.0_language-cs.appx
Bookshelf_8.2.22.0_language-cy.appx
Bookshelf_8.2.22.0_language-da.appx
Bookshelf_8.2.22.0_language-de.appx
Bookshelf_8.2.22.0_language-el.appx
Bookshelf_8.2.22.0_language-es.appx
Bookshelf_8.2.22.0_language-fi.appx
Bookshelf_8.2.22.0_language-fr.appx
Bookshelf_8.2.22.0_language-ga.appx
Bookshelf_8.2.22.0_language-he.appx
Bookshelf_8.2.22.0_language-hi.appx
Bookshelf_8.2.22.0_language-hu.appx
Bookshelf_8.2.22.0_language-is.appx
Bookshelf_8.2.22.0_language-it.appx
Bookshelf_8.2.22.0_language-ja.appx
Bookshelf_8.2.22.0_language-ko.appx
Bookshelf_8.2.22.0_language-nb.appx
Bookshelf_8.2.22.0_language-nl.appx
Bookshelf_8.2.22.0_language-pl.appx
Bookshelf_8.2.22.0_language-pt.appx
Bookshelf_8.2.22.0_language-ro.appx
Bookshelf_8.2.22.0_language-ru.appx
Bookshelf_8.2.22.0_language-sv.appx
Bookshelf_8.2.22.0_language-th.appx
Bookshelf_8.2.22.0_language-tr.appx
Bookshelf_8.2.22.0_language-vi.appx
Bookshelf_8.2.22.0_language-zh-hans.appx
Bookshelf_8.2.22.0_language-zh-hant.appx
Bookshelf_8.2.22.0_scale-100.appx
Bookshelf_8.2.22.0_scale-125.appx
Bookshelf_8.2.22.0_scale-150.appx
Bookshelf_8.2.22.0_scale-400.appx
Bookshelf_8.2.22.0_x64.appx
[Content_Types].xml
AppxMetadata\AppxBundleManifest.xml


Notes

C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -noprofile -command “Add-AppxPackage -Path setup.appx”

 

tags: MrNetTek

C# – Turn Off Computer Screen

email me

Tested in Visual Studio Community 2017.

Create new project > Select Windows Form App (.NET Framework) > Drag button to form > Add code to Form1.cs > Compile & Run

using System.Runtime.InteropServices;

public int WM_SYSCOMMAND = 0x0112;
public int SC_MONITORPOWER = 0xF170;

[DllImport("user32.dll")]
private static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);

private void button1_Click(object sender, System.EventArgs e)
{

SendMessage( this.Handle.ToInt32(), WM_SYSCOMMAND, SC_MONITORPOWER, 2 );
}


Output

 


Notes

On -1

Off 2

Standby 1

 

tags: form, button, MrNetTek