Table of Contents

Batch-Scripts

Passworteingabe durch Sterne verbergen

:GetPassword
pushd %tmp%
>  pwd.ps1 Echo $Password = Read-Host -assecurestring
>> pwd.ps1 Echo $BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password)
>> pwd.ps1 Echo $PlainPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)
>> pwd.ps1 Echo Write-Host $PlainPassword
for /f "delims=" %%a in ('Powershell -executionpolicy remotesigned -File pwd.ps1') do set %1=%%a
del pwd.ps1
popd

Lokale Benutzer erstellen

Erstellt die lokalen Benutzer und fügt sie den Gruppen hinzu. Dabei wird festgelegt, dass Passwörter nicht geändert werden dürfen und nicht ablaufen.

net user bsm 12345 /add /PASSWORDCHG:NO
net user bsm-install 12345 /add /PASSWORDCHG:NO
net localgroup administratoren bsm-install /add
wmic useraccount where "Name='bsm'" set PasswordExpires=false
wmic useraccount where "Name='bsm-install'" set PasswordExpires=false

SysInfoTool

SysteminfoTool.bat
@echo off
 
COLOR 0a
 
title Seit wann l„uft mein System?
 
echo ###############################################################################
echo # SysteminfoTool                 v1.7                     by Matteo Grunwald  #
echo #              vist m4tt30.de and wiki.m4tt30.de                              #
echo #                 Thanks Stefan Mller for the idea ;)                        #
echo ###############################################################################
echo.
echo. 
echo.
 
 
:start
echo A Netzwerkkonfiguration
echo B Informationen ber den Computer und Hersteller
echo C Informationen ber Windows und Hardware (!!Startet ein externes Programm!!) 
echo D Systemstartzeit
echo E Programm beenden
echo.
CHOICE /C abcde /M "W„hlen Sie eine Option aus der oberen Liste."
echo.
echo ===============================================================================
echo.
 
if errorlevel 5 goto m1
if errorlevel 4 goto m2
if errorlevel 3 goto m3
if errorlevel 2 goto m4
if errorlevel 1 goto m5
 
:m5
ipconfig /all | find "IPv4-Adresse"
ipconfig /all | find "Subnetzmaske"
ipconfig /all | find "Standardgateway"
ipconfig /all | find "DHCP-Server"
ipconfig /all | find "DNS-Server"
echo.
echo ===============================================================================
echo.
goto start
 
:m4
WMIC csproduct get Vendor, Name, Version, IdentifyingNumber
echo.
echo ===============================================================================
echo.
goto start
 
:m3
MSINFO32
echo ===============================================================================
echo.
goto start
 
:m2
Systeminfo | find "Systemstartzeit"
echo.
echo ===============================================================================
echo.
goto start
 
:m1
exit