script-example.com

the quick introduction to common scripting languages, as well as sample scripts.


📁 Topics

PowerShell

Preview PowerShell

In the modern world, everyone strives for automation. Automating everyday tasks increases efficiency and can avoid errors caused by repetitive monotonous work. PowerShell can be used to automate such mundane tasks.


Windows Batch

Preview Windows Batch

Batch files can be used to automate simple processes in Microsoft Windows. Batch files use the commands of the command prompt, in the simplest case these cmd commands can be entered in a simple text file line by line, it is then executed one command after the other. Windows batch originate from the MS-DOS era. At that time batch files had the file extension .bat. Since Windows 2000 the extension .cmd is used. Additionally there is the possibility to use jump labels or variables, up to more compl...


ESP

Preview ESP


📰 New Posts

Preview PowerShell Version: get-host
PowerShell /

PowerShell version 7.3.2 released

changed: 2023-01-24 from Bernhard (Initial Release: 2022-05-02)

The PowerShell version can be displayed with the get-host command. ... continue reading

Robocopy example - server relocation
Windows Batch /

Robocopy example - server relocation

created: 2022-12-12 from Bernhard

Even in times of Windows PowerShell there are certain commands that still do not have a worthy successor in Windows PowerShell. One of these commands is undoubtedly the good old robocopy command. ... continue reading

Send PowerShell Email: Send-MailMessage
PowerShell /

Send PowerShell Email: Send-MailMessage

created: 2022-12-09 from Bernhard

... continue reading

ESP32 Flowmeter - RS485 Modbus
ESP /

ESP32 Flowmeter - RS485 Modbus

changed: 2022-12-09 from Bernhard (Initial Release: 2022-11-04)

In the meantime I use ESP-Home for the readout ... continue reading

Preview PowerShell: Prevent screen saver, lock: Move mouse regularly
PowerShell /

PowerShell: Prevent screen saver, lock: Move mouse regularly

created: 2022-12-02 from Bernhard

Alternatively, if you can't change the screen lock settings, you can move the mouse regularly, or have a script move the mouse. Originally published as an AutoIt script, I recreated the script with a few PowerShell lines. Anyone who copies the following commands into a PowerShell session will prevent the computer from locking the screen or starting the screensaver: ... continue reading

Preview Restore file version history
PowerShell /

Restore file version history

created: 2022-12-01 from Bernhard

The PowerShell script presented here copies the latest files of the file version history to any folder or to another computer. In the copy, the date is removed from the file name, thus restoring the original file names. ... continue reading

Bash function and logging for an rsync backup script

Bash function and logging for an rsync backup script

created: 2022-11-30 from Bernhard

To synchronize multiple folders via rsync, the individual folders for the sync can be written into a bash file as follows, so far so simple: ... continue reading

Preview PowerShell task scheduling: restart computer or server
PowerShell /

PowerShell task scheduling: restart computer or server

created: 2022-11-15 from Bernhard

A scheduled task in Windows can of course also be created via PowerShell. ... continue reading

Practical examples with batch
Windows Batch /

Practical examples with batch

created: 2022-11-08 from Bernhard

Handling variables in Windows Batch (command prompt) Read all variables Variables can be read out in the command prompt with the set command: ... continue reading

Sequence loops and jump labels batch file: loop goto
Windows Batch /

Sequence loops and jump labels batch file: loop goto

created: 2022-11-04 from Bernhard

Jump marks: Example: ... continue reading

DS18B20 Temperature Sensors ESP32, MQTT and WiFi - HowTo
ESP /

DS18B20 Temperature Sensors ESP32, MQTT and WiFi - HowTo

created: 2022-11-04 from Bernhard

In addition to connecting a flow meter via RS485, I plugged 5-piece DS18B20 temperature sensors to the ESP32 so that their values are also transmitted to HomeAssistant via MQTT. ... continue reading

ESP32 programming, Arduino - install requirements
ESP /

ESP32 programming, Arduino - install requirements

created: 2022-11-04 from Bernhard

I have not had much to do with Arduino or microcontrollers, apart from updating and operating my 3D printer. Microcontrollers, for example the ESP32, offer a cheap alternative to the Raspberry Pi for certain purposes, such as collecting data or certain control or monitoring tasks : WLAN and Bluetooth included . After entering new territory for me here, I wanted to share my experience from a beginner's point of view. Background of my efforts was a concrete use case. ... continue reading