An open API service indexing awesome lists of open source software.

https://github.com/hernancerm/batchscripts

Great Batch scripts for miscellaneous purposes.
https://github.com/hernancerm/batchscripts

automation batch-script image-processing

Last synced: 5 months ago
JSON representation

Great Batch scripts for miscellaneous purposes.

Awesome Lists containing this project

README

          

## Recommended setup 💡

Create a directory in %USERPROFILE% (the home directory) and save the batch files there. Add this folder to the user's Path environment variable. If you have trouble modifying the variable there are many helpful resources, e.g.: [this HowTech YouTube video](https://www.youtube.com/watch?v=bEroNNzqlF4). After configuring the Path variable, the batch files can be called like system commands, such as *dir* or *cd* (from anywhere in the file system).

## Security

### backup

```
backup
```

Creates (or updates) a password-protected .7z file with the contents of the folder to backup (``) in the specified directory (``). It makes sense to do a backup on a separate disk; to achieve this, `` should point to the external disk in the following format: `:`, e.g.: `D:`. The first time the script is run an archive will be created. Any subsequent calls to the script (whilst the configuration file bconf.csv remains the same) will update the archive, deleting from the archive removed files from disk, updating modified files and adding the new files. **Neither creating nor updating an archive deletes, adds or modifies sensitive files, i.e. the integrity of `` is always kept intact, even if the backup process abruptly terminates**. This script requires [7-Zip](https://www.7-zip.org/download.html) to be installed and a separate configuration file to work. The configuration file must be named *bconf.csv*, it must exist in the same directory as backup.bat and the content must be a single line with the following format:

```
,,
```

If the password is omitted, a command line window will prompt the user to enter a password. Pressing just `enter`sets the password to `enter` itself, it's the closest I've found to not setting a password without working extra on the batch script.

## Image processing

The scripts in this category require [ImageMagick](https://imagemagick.org/) and [cwebp](https://developers.google.com/speed/webp/docs/precompiled) to be installed and accessible from any path in cmd.exe (`Path` user environment variable may need to be configured).

### witra (Whatsapp Image TRAnsform)

```
witra
```

| Non-terminal | Description |
| --------------- | --------------------------------------------------- |
| `` | Absolute path to a PNG image file. |
| `` | Absolute path of parent directory of output folder. |

Transforms a target PNG image to a 512x512px webP < 100Kb file. Aspect ratio of image contents and transparency are not changed. Files which names contain white spaces or commas are not supported.

### wbtra (Whatsapp Batch TRAnsform)

```
wbtra
```

| Non-terminal | Description |
| -------------- | ------------------------------------------------------------------------------------------ |
| `` | Absolute or relative path of directory containing images that can be processed by `witra`. |

Processes images contained in the target directory with `witra`. The output images are placed in a new folder in the parent directory of the target directory. The development of this script emerged from the necessity to convert a large number of WhatsApp stickers provided in PNG with varying dimensions to the required [standard](https://github.com/WhatsApp/stickers/tree/master/Android).