Skip to content

Commit 40b1792

Browse files
committed
Upload
0 parents  commit 40b1792

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+425
-0
lines changed

7-Zip/compress.bat

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
3+
rem Send To Compress (7-Zip) Explorer action.
4+
5+
7z a -t7z -mx9 "%~dpnx1".7z -- %*

7-Zip/extract.bat

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@echo off
2+
3+
rem Send To Extract (7-Zip) Explorer action.
4+
rem Autodetect subfolder.
5+
6+
:LOOP
7+
8+
if $%1==$ exit
9+
7z x -o"%~dp1%~n1" %1
10+
11+
set COUNT=0
12+
for /f %%I in ("%~dp1%~n1\*") do set /a COUNT+=1
13+
14+
setlocal enabledelayedexpansion
15+
16+
if %COUNT% equ 1 (
17+
if exist "%~dp1%~n1\%~n1" (
18+
set RANDOMPATH=%RANDOM%%RANDOM%%RANDOM%
19+
move /y "%~dp1%~n1" "%~dp1!RANDOMPATH!"
20+
move /y "%~dp1!RANDOMPATH!\%~n1" "%~dp1%~n1"
21+
rmdir /q "%~dp1!RANDOMPATH!"
22+
)
23+
)
24+
25+
endlocal
26+
27+
shift
28+
goto LOOP

Explorer/fluent_terminal_add.reg

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Windows Registry Editor Version 5.00
2+
3+
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\flute]
4+
@="Open Terminal here"
5+
6+
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\flute\command]
7+
@="C:\\Users\\Jupiter\\AppData\\Local\\Microsoft\\WindowsApps\\flute.exe"

Explorer/fluent_terminal_remove.reg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Windows Registry Editor Version 5.00
2+
3+
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\flute]

GIF/optimize-all.bat

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
set RANDOMPATH=%RANDOM%%RANDOM%%RANDOM%
5+
dir /s /b %1\*.gif > %RANDOMPATH%.txt
6+
7+
for /f "tokens=*" %%I in (%RANDOMPATH%.txt) do (
8+
echo %%I
9+
bin\gifsicle.exe -O3 --careful --batch "%%I"
10+
)
11+
12+
del /q /f %RANDOMPATH%.txt
13+
pause

GIF/optimize-lossy-all.bat

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
set RANDOMPATH=%RANDOM%%RANDOM%%RANDOM%
5+
dir /s /b %1\*.gif > %RANDOMPATH%.txt
6+
7+
for /f "tokens=*" %%I in (%RANDOMPATH%.txt) do (
8+
echo %%I
9+
bin\gifsicle.exe -O3 --lossy=84 --careful -o "%%~dpnI.lossy.gif" "%%I"
10+
)
11+
12+
del /q /f %RANDOMPATH%.txt
13+
pause

GIF/optimize-lossy.bat

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
bin\gifsicle.exe -O3 --lossy=84 --careful -o "%~dpn1.lossy.gif" %1

GIF/optimize.bat

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
bin\gifsicle.exe -O3 --careful --batch %1

JPEG/convert-all.bat

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
set RANDOMPATH=%TEMP%\%RANDOM%%RANDOM%%RANDOM%
5+
dir /s /b %1\*.bmp > %RANDOMPATH%.log
6+
dir /s /b %1\*.tga >> %RANDOMPATH%.log
7+
8+
for /f "tokens=*" %%I in (%RANDOMPATH%.log) do (
9+
echo %%I
10+
bin\cjpeg.exe -progressive -optimize -quality 84 "%%I" > "%%~dpnI.jpg"
11+
)
12+
13+
del /q /f %RANDOMPATH%.log
14+
pause

JPEG/convert.bat

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
bin\cjpeg.exe -progressive -optimize -quality 84 %1 > "%~dpn1.jpg"

JPEG/optimize-all.bat

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
set RANDOMPATH=%TEMP%\%RANDOM%%RANDOM%%RANDOM%
5+
dir /s /b %1\*.jpg > %RANDOMPATH%.log
6+
dir /s /b %1\*.jpeg >> %RANDOMPATH%.log
7+
8+
for /f "tokens=*" %%I in (%RANDOMPATH%.log) do (
9+
echo %%I
10+
bin\jpegtran.exe -copy none -optimize -progressive -outfile "%%I" "%%I"
11+
)
12+
13+
del /q /f %RANDOMPATH%.log
14+
pause

JPEG/optimize.bat

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
bin\jpegtran.exe -copy none -optimize -progressive -outfile %1 %1

LICENSE.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<h1 align="center">Do What the Fuck You Want to Public License</h1>
2+
<p align="center"><i>by Ubihazard</i></p>
3+
4+
<!--
5+
Do What the Fuck You Want to Public License
6+
===========================================
7+
8+
(by Ubihazard)
9+
-->
10+
11+
Terms and conditions for usage, copying, modification,
12+
and distribution of the included work:
13+
14+
* Just do what the fuck you want to.

PNG/optimize-all.bat

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
set RANDOMPATH=%RANDOM%%RANDOM%%RANDOM%
5+
dir /s /b %1\*.png > %RANDOMPATH%.txt
6+
7+
for /f "tokens=*" %%I in (%RANDOMPATH%.txt) do (
8+
echo %%I
9+
bin\PNGKT.exe "%%I"
10+
bin\optipng.exe -o7 -strip all -preserve -clobber "%%I"
11+
)
12+
13+
del /q /f %RANDOMPATH%.txt
14+
pause

PNG/optimize-full-all.bat

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
set RANDOMPATH=%RANDOM%%RANDOM%%RANDOM%
5+
dir /s /b %1\*.png > %RANDOMPATH%.txt
6+
7+
for /f "tokens=*" %%I in (%RANDOMPATH%.txt) do (
8+
echo %%I
9+
bin\PNGKT.exe "%%I"
10+
bin\pngout.exe /f6 /y /v "%%I"
11+
)
12+
13+
del /q /f %RANDOMPATH%.txt
14+
pause

PNG/optimize-full.bat

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
bin\PNGKT.exe %1
5+
bin\pngout.exe /f6 /y /v %1

PNG/optimize.bat

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
bin\PNGKT.exe %1
5+
bin\optipng.exe -o7 -strip all -preserve -clobber %1

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Windows Scripts
2+
===============
3+
4+
Assorted `.bat`, `.reg`, and other scripts to help make life on Windows easier.
5+
6+
PowerShell One-liners
7+
---------------------
8+
9+
Remove all `Appx` packages except Windows Store:
10+
11+
```powershell
12+
Get-AppxPackage | where-object {$_.name –notlike '*store*'} | Remove-AppxPackage
13+
```
14+
15+
Same as above, but remove for all users:
16+
17+
```powershell
18+
Get-AppxPackage -AllUsers | where-object {$_.name –notlike '*store*'} | Remove-AppxPackage -AllUsers
19+
```
20+
21+
Also remove `Appx` installation packages that can be used to restore them (e.g. when creating a new Windows user):
22+
23+
```powershell
24+
Get-AppxProvisionedPackage –online | where-object {$_.packagename –notlike '*store*'} | Remove-AppxProvisionedPackage -online
25+
```
26+
27+
Support
28+
-------
29+
30+
If you find anything of this useful, you can [buy me a ☕](https://www.buymeacoffee.com/ubihazard "Show support")!

System/utc_clock.reg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Windows Registry Editor Version 5.00
2+
3+
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
4+
"RealTimeIsUniversal"=qword:00000001

Theme/accents.reg

862 Bytes
Binary file not shown.

Theme/clear.reg

434 Bytes
Binary file not shown.

Theme/colors.reg

322 Bytes
Binary file not shown.

Theme/max_wallpaper_quality.reg

240 Bytes
Binary file not shown.

WebP/convert-all.bat

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
set RANDOMPATH=%TEMP%\%RANDOM%%RANDOM%%RANDOM%
5+
dir /s /b %1\*.bmp > %RANDOMPATH%.log
6+
dir /s /b %1\*.tga >> %RANDOMPATH%.log
7+
8+
for /f "tokens=*" %%I in (%RANDOMPATH%.log) do (
9+
echo %%I
10+
bin\cwebp.exe "%%I" -o "%%~dpnI.webp"
11+
)
12+
13+
del /q /f %RANDOMPATH%.log
14+
pause

WebP/convert.bat

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
bin\cwebp.exe %1 -o "%~dpn1.webp"

WebP/lossless-all.bat

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
set RANDOMPATH=%TEMP%\%RANDOM%%RANDOM%%RANDOM%
5+
dir /s /b %1\*.bmp > %RANDOMPATH%.log
6+
dir /s /b %1\*.tga >> %RANDOMPATH%.log
7+
8+
for /f "tokens=*" %%I in (%RANDOMPATH%.log) do (
9+
echo %%I
10+
bin\cwebp.exe -z 9 "%%I" -o "%%~dpnI.webp"
11+
)
12+
13+
del /q /f %RANDOMPATH%.log
14+
pause

WebP/lossless.bat

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
bin\cwebp.exe -z 9 %1 -o "%~dpn1.webp"

WinRAR/compress.bat

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@echo off
2+
3+
rem Send To Compress (RAR) Explorer action.
4+
5+
set NAME=-ep1 "%~dpnx1.rar"
6+
if $%2==$ goto COMPRESS
7+
8+
set DESTINATION=%~dp1
9+
if %DESTINATION:~-1%==\ set DESTINATION=%DESTINATION:~0,-1%
10+
11+
set PARENT=
12+
for /d %%p in ("%DESTINATION%") do set PARENT=%%~nxp
13+
14+
set NAME="%~dp1%PARENT%"
15+
if exist %NAME% (
16+
set NAME=-ep1 -ag "%~dp1%PARENT%.rar"
17+
) else (
18+
set NAME=-ep1 "%~dp1%PARENT%.rar"
19+
)
20+
21+
:COMPRESS
22+
Rar a %NAME% %*

WinRAR/extract.bat

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@echo off
2+
3+
rem Send To Extract (RAR) Explorer action.
4+
rem Autodetect subfolder.
5+
6+
set UNRAR="%~dp0UnRAR"
7+
8+
:LOOP
9+
10+
if $%1==$ exit
11+
12+
pushd "%~dp1"
13+
%UNRAR% x -ad %1
14+
popd
15+
16+
set COUNT=0
17+
for /f %%I in ("%~dp1%~n1\*") do set /a COUNT+=1
18+
19+
setlocal enabledelayedexpansion
20+
21+
if %COUNT% equ 1 (
22+
if exist "%~dp1%~n1\%~n1" (
23+
set RANDOMPATH=%RANDOM%%RANDOM%%RANDOM%
24+
move /y "%~dp1%~n1" "%~dp1!RANDOMPATH!"
25+
move /y "%~dp1!RANDOMPATH!\%~n1" "%~dp1%~n1"
26+
rmdir /q "%~dp1!RANDOMPATH!"
27+
)
28+
)
29+
30+
endlocal
31+
32+
shift
33+
goto LOOP

WinRAR/rar.ini

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
switches=-m5 -s -rr

cleanup.bat

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
3+
:: Explorer
4+
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\WordWheelQuery" /f
5+
6+
:: PowerShell
7+
del /q /f "%APPDATA%\Microsoft\Windows\PowerShell\PSReadline\*.txt"
8+
9+
:: WSL
10+
del /q /f "%LOCALAPPDATA%\lxss\home\%USERNAME%\.bash_history"
11+
12+
:: WinRAR
13+
reg delete "HKCU\Software\WinRAR\ArcHistory" /f
14+
15+
:: MuPDF
16+
del /q /f "%USERPROFILE%\.mupdf.history"
17+
18+
:: Node.js
19+
del /q /f "%USERPROFILE%\.node_repl_history"
20+
21+
:: CMake
22+
reg delete "HKCU\Software\Kitware" /f
23+
24+
:: NVIDIA
25+
::rmdir /s /q "%APPDATA%\NVIDIA\ComputeCache"
26+
::rmdir /s /q "%APPDATA%\NVIDIA\GLCache"
27+
28+
:: Other
29+
rmdir /s /q "%USERPROFILE%\.thumbnails"
30+
rmdir /s /q "%LOCALAPPDATA%\fontconfig"
31+
del /q /f "%USERPROFILE%\.recently-used.xbel"

cmake-llvm.bat

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
cmake.exe -T "llvm" %*

cmake-mingw.bat

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
cmake.exe -G "MinGW Makefiles" %*

cmake-vs2017.bat

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
cmake.exe -G "Visual Studio 15 2017" %*

flushdns.bat

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
3+
:: Drop outdated DNS cache entries
4+
5+
ipconfig /flushdns

gpnow.bat

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
3+
:: Force update of modified group policies immediately
4+
5+
gpupdate /force

make.bat

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
mingw32-make.exe %*

msg.jse

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Display message in a dialog box from scripts */
2+
if (WScript.Arguments.length == 0) WScript.Quit(1);
3+
WScript.Echo(WScript.Arguments(0));

rrename.bat

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@echo off
2+
cd /d "%~dp0"
3+
4+
:: Give items random file names
5+
6+
:loop
7+
for /f "tokens=* usebackq" %%f in (`uuidgen.bat raw`) do (
8+
set uuid=%%f
9+
)
10+
move %1 "%~dp1%uuid%%~x1"
11+
shift
12+
if not "%~1"=="" goto loop

0 commit comments

Comments
 (0)