Skip to content

Instantly share code, notes, and snippets.

# Download from link in clipboard preserving timestamp
$clip = (Get-Clipboard)
Write-Host URL: $clip
try { (Invoke-WebRequest $clip -Method Head).Headers.'Last-Modified' } catch { Write-Warning "Last-Modified error" }
try { (Invoke-WebRequest $clip -Method Head).Headers.'Content-Length'/1mb } catch { Write-Warning "Content-Length error" }
Write-Host `n"DOWNLOAD?" -ForegroundColor Green
pause
Start-BitsTransfer -Source $clip -Destination (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path
:: Пакетная конвертация видеофайлов с помощью пресетов HandBrake
:: https://t.me/wincmd64
:: ИСПОЛЬЗОВАНИЕ:
:: 1. сохранить код в .bat-файл и поместить рядов с HandBrakeCLI.exe
:: 2. создать ярлык на .bat-файл в папке Shell:SendTo
:: 3. выделить нужные видеофайлы и выбрать в контекстном меню пункт Отправить > *имя_ярлыка*
:: 4. выбрать в открывшимся окне нужный пресет и дождаться окончания конвертации
:: HandBrakeCLI.exe -- https://handbrake.fr/downloads2.php
# Авто-установка chocolatey и софта
# Использование: powershell -ExecutionPolicy Bypass -File "choco.ps1"
# https://t.me/wincmd64
# ps ver check
if ($PSversiontable.psversion -lt "5.1") {
Write-Host "POWERSHELL UPDATE NEEDED -- https://microsoft.com/download/details.aspx?id=54616"
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
exit
}
Windows Registry Editor Version 5.00
; добавляет в меню файлов и папок пункт "Emsisoft Scanner"
; https://t.me/wincmd64
; Использование:
;
; 1. Скачать и распаковать:
; https://www.emsisoft.com/en/commandline-scanner/
; x64 -- https://dl.emsisoft.com/EmsisoftCommandlineScanner64.exe
# Рекурсивно удаляет файлы старше Х дней в заданной директории (минуя Корзину)
# Использование: powershell -ExecutionPolicy Bypass -File "clean_temp.ps1"
# Кодировка этого файла должна быть UTF-8 с BOM
# https://t.me/wincmd64
# Кол-во дней
$days = 30
# Путь, например, 'D:\test'
$path = $env:Temp
:: Windows 7 quick setup
:: The encoding of this file must be OEM 866
:: https://t.me/wincmd64
:: Tested on: https://nnmclub.to/forum/tracker.php?pid=1428251
:: Drivers can be found at: https://sdi-tool.org
@echo off
:: UAC check
<#
.SYNOPSIS
alternative way to update TotalCmd with selected installer
.DESCRIPTION
in this example, all language packs will be updated
and junk files (like 'SIZE!.TXT' or '*.WUL') will not be copied
.EXAMPLE
powershell -ExecutionPolicy Bypass -File "TCupdate.ps1" "x:\path to\totalcmd"
:: Windows 10\11 quick setup
:: The encoding of this file must be OEM 866
:: https://t.me/wincmd64
@echo off
NET SESSION
IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE
GOTO ADMINTASKS
:ELEVATE
cls
:: Downloads video from link in clipboard using yt-dlp and ffmpeg
:: yt-dlp.exe -- https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe
:: ffmpeg.exe -- https://github.com/GyanD/codexffmpeg/releases/download/6.1.1/ffmpeg-6.1.1-essentials_build.7z
:: https://t.me/wincmd64
@echo off
:: finds the downloads folder
FOR /F "USEBACKQ TOKENS=2,*" %%a IN (
`REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /V {374DE290-123F-4565-9164-39C4925E467B}`