Benutzer-Werkzeuge

Webseiten-Werkzeuge


Seitenleiste

3D

INTERN

ADOBE

ARDUINO

BITBUCKET

DOCKER

C4D

GIT

HTML

IPHONE

JAVASCRIPT

JTL-SHOP

LARAVEL

MAGENTO2

MYSQL

PHP

PLESK

PROCESSING

PYTHON

SUITECRM

SEO

TRYTON

THUNDERBIRD / ICEDOVE / FossaMail

TYPO3

TYPO3: BACKEND

TYPO3: TYPOSCRIPT

UNIX

VLC

VVVV

WINDOWS

WINDOWS 10

WORDPRESS

XAMPP

XT:C 4 (Veyton)

batch-script-to-start-new-wordpress-project

batch Script to start new wordpress project

Description

The batch script

  • generates a folder structure
  • fetches latest (german) wordpress packet, extracts it and renames the folder to public_html
  • creates database for project
  • !read the script before u use it!

Prerequisits

  • wget for windows in path [1]
  • 7zip is installed [2]
  • xampp is being used and mysqladmin.exe is in userpath (and root password is set)
  • script lacation is in C:\xampp\htdocs

script

@echo off

:: check if mysql is running
SETLOCAL EnableExtensions
set EXE=mysqld.exe
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto FOUND
    goto sql_not_running
goto FIN
:FOUND
    goto continue
:FIN
 
:continue
:: get data
set /p dbPassword= Please give mysql password (for user: root):
set /p projectName= Please give projectname (will be used to create database): 
set dbName=lokal_wp_%projectName%
set projectDir=%dbName%
echo database and projectDir will be: %dbName%

:: generate directory structure
mkdir %projectDir%\backups %projectDir%\clientdata %projectDir%\psd
mkdir %projectDir%\backups\sql

:: fetch wordpress (german)
wget --no-check-certificate https://de.wordpress.org/latest-de_DE.zip -O %projectDir%\latest-de_DE.zip
 
"C:\Program Files\7-Zip\7z.exe" x %projectDir%\latest-de_DE.zip -oC:\xampp\htdocs\%projectDir%\
 
Rename %projectDir%\wordpress public_html

:: create database for cli parameter (projectname)
set dbUser=root
 
set dbName= lokal_wp_%projectName%
 
mysqladmin -u%dbUser% -p%dbPassword% create %dbName%
 
 
exit
 
:sql_not_running
echo -----------------------------
echo !!WARNING COULDN'T CONTINUE!!
echo -----------------------------
echo Message: mysqld.exe is not running, please start it (e.g. via xampp-control)
batch-script-to-start-new-wordpress-project.txt · Zuletzt geändert: 2015/09/01 11:07 von admin