Windows batch remove squared brackets

@echo off
setlocal enableextensions disabledelayedexpansion

set "search1=["
set "replace1=("
set "search2=]"
set "replace2=)"

set "textFile=test.txt"

(for /f "delims=" %%i in ('type "%textFile%"') do (
    set "line=%%i"
    setlocal enabledelayedexpansion
    set "line=!line:%search1%=%replace1%!"
    set "line=!line:%search2%=%replace2%!"
    echo(!line!
    endlocal
)) > "%textFile%.tmp"

move /y "%textFile%.tmp" "%textFile%" >nul

Windows remote rename (AD) computers

# oldname, newname
$Computers = import-csv .\Rename.csv
$adminUser = Get-Credential
# "PREFIX- +" "+ $SerNum"
$Computers = Import-Csv ServerNames.csv -Header OldName, NewName
Foreach ( $Computer in $Computers ) 
{
	Rename-Computer -ComputerName $Computer.OldName -NewName $Computer.NewName -DomainCredential $adminUser -Force -PassThru
}

Windows Update Error 0x80073712

Run the DISM tool

  1. tap Search.
  2. Enter command prompt in the search box.
  3. In the list of results, swipe down on or right-click Command Prompt, and then tap or click Run as administrator.
  4. In the Administrator: Command Prompt window, type the following commands. Press the Enter key after each command:
DISM.exe /Online /Cleanup-image /Scanhealth
DISM.exe /Online /Cleanup-image /Restorehealth
  1. To close the Administrator: Command prompt window, type Exit, and then press Enter.
  2. Run Windows Update again.

Sophos Root partition is filling up

Root partition is filling up – please check. Current usage: 85%
Sophos UTM-9
HA Status          : HA MASTER (node id: 1)
System Uptime      : 60 days 6 hours 27 minutes
System Load        : 1.43
System Version     : Sophos UTM 9.715-4
Please refer to the manual for detailed instructions.

Solution

/etc/init.d/postgresql92 rebuild
/etc/init.d/postgresql92 start

Archive for category Technik

Archives by Month: