Install-WindowsService: Readme added, New Batch Caller, now with admin and PS 7 support
This commit is contained in:
parent
4815bea47d
commit
3ec35d447d
@ -1,45 +1,135 @@
|
|||||||
|
TITLE DIGITAL DATA - Run all files in directory
|
||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
TITLE DIGITAL DATA - Run all files in directory with current permissions
|
REM ----------------------------------------------------------------------------
|
||||||
ECHO -
|
REM This script runs all specified files in the current directory
|
||||||
ECHO Batch Script
|
REM
|
||||||
ECHO Run all files in directory with current permissions
|
REM Returns: <NOTHING>
|
||||||
ECHO -
|
REM ----------------------------------------------------------------------------
|
||||||
ECHO Digital Data
|
REM Copyright (c) 2024 by Digital Data GmbH
|
||||||
ECHO Ludwig-Rinn-Strasse 16
|
REM
|
||||||
ECHO 35452 Heuchelheim
|
REM Digital Data GmbH • Ludwig-Rinn-Strasse 16 • D-35452 Heuchelheim
|
||||||
ECHO Tel.: 0641 / 202360
|
REM Tel.: 0641/202360 • E-Mail: info-flow@digitaldata.works
|
||||||
ECHO E-Mail: info@didalog.de
|
REM ----------------------------------------------------------------------------
|
||||||
ECHO -
|
REM Creation Date / Author: 13.08.2015 / MK
|
||||||
ECHO Version 1.0.0.0
|
REM Version Date / Editor: 23.11.2024 / MK
|
||||||
ECHO Date: 13.08.2015
|
REM Version Number: 2.0.0.0
|
||||||
ECHO -
|
|
||||||
ECHO Program Startup %date% at %time:~0,8% oclock, on %computername%.
|
|
||||||
|
|
||||||
REM --------------------------------------------------------------
|
REM --------------------------------------------------------------
|
||||||
REM ------------------------set variables-------------------------
|
REM ------------------------set variables-------------------------
|
||||||
REM --------------------------------------------------------------
|
REM --------------------------------------------------------------
|
||||||
|
|
||||||
setlocal enableextensions
|
SET FILEEXTENSION=*.ps1
|
||||||
|
SET POWERSHELLEXE="C:\Program Files\PowerShell\7\pwsh.exe"
|
||||||
|
SET /A ADMINMODE=1
|
||||||
|
|
||||||
SET DIRECTORY="%cd%"
|
SET DIRECTORY="%cd%"
|
||||||
SET FILEEXTENSION=*.ps1
|
SET /A COUNT=0
|
||||||
SET COUNT=0
|
SET LOGFILE="%cd%\error.log"
|
||||||
|
|
||||||
REM --------------------------------------------------------------
|
REM --------------------------------------------------------------
|
||||||
REM ---------------------Program 1 / Script 1---------------------
|
REM ------------------------preparing part------------------------
|
||||||
REM --------------------------------------------------------------
|
REM --------------------------------------------------------------
|
||||||
|
|
||||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (ECHO %%f && set /a count+=1)
|
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||||
ECHO -
|
ECHO Program Startup %date% at %time:~0,8% o'clock, on %computername%.
|
||||||
ECHO Found %count% File(s) with File Extension %FILEEXTENSION% in Directory:
|
|
||||||
ECHO %DIRECTORY%.
|
|
||||||
|
|
||||||
ECHO -
|
ECHO -
|
||||||
ECHO Running this/them now, with your permissions!
|
IF !ADMINMODE! EQU 1 (ECHO WARNING: In AdminMode, network drives will maybe unavailable! && timeout /T 10)
|
||||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (PowerShell.exe -Command "& {Start-Process 'C:\Program Files\PowerShell\7\pwsh.exe' -Verb runAs '-ExecutionPolicy Bypass -File "%%f"'}")
|
|
||||||
|
REM --------------------------------------------------------------
|
||||||
|
REM ---------------------Running Scripts---------------------------
|
||||||
|
REM --------------------------------------------------------------
|
||||||
|
|
||||||
|
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (
|
||||||
|
ECHO %%f
|
||||||
|
SET /a COUNT+=1
|
||||||
|
)
|
||||||
|
ECHO -
|
||||||
|
ECHO Found %COUNT% File(s) with File Extension %FILEEXTENSION% in Directory:
|
||||||
|
ECHO %DIRECTORY%
|
||||||
|
|
||||||
ECHO -
|
ECHO -
|
||||||
|
IF EXIST "!POWERSHELLEXE!" (
|
||||||
|
ECHO Running these scripts now:
|
||||||
|
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (
|
||||||
|
|
||||||
|
ECHO -
|
||||||
|
SET "SCRIPT=%%f"
|
||||||
|
ECHO Running script:
|
||||||
|
ECHO !SCRIPT!
|
||||||
|
|
||||||
|
ECHO -
|
||||||
|
SET "ARGUMENTS=-NoProfile -ExecutionPolicy Bypass -File \""!SCRIPT!\"""
|
||||||
|
ECHO With Arguments:
|
||||||
|
ECHO !ARGUMENTS!
|
||||||
|
|
||||||
|
ECHO -
|
||||||
|
SET "SUBCOMMAND=Start-Process -FilePath '!POWERSHELLEXE!' -ArgumentList '!ARGUMENTS!' "
|
||||||
|
ECHO Subcommand:
|
||||||
|
ECHO !SUBCOMMAND!
|
||||||
|
|
||||||
|
ECHO -
|
||||||
|
IF !ADMINMODE! EQU 1 (
|
||||||
|
SET "COMMAND=Start-Process powershell.exe -Verb runas {!SUBCOMMAND!} "
|
||||||
|
) ELSE (
|
||||||
|
SET "COMMAND=Start-Process powershell.exe {!SUBCOMMAND!} "
|
||||||
|
)
|
||||||
|
ECHO In nested command:
|
||||||
|
ECHO !COMMAND!
|
||||||
|
|
||||||
|
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "!COMMAND!"
|
||||||
|
|
||||||
|
IF ERRORLEVEL 1 (
|
||||||
|
ECHO There was an error running the script: !SCRIPT! >> !LOGFILE!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) ELSE (
|
||||||
|
ECHO WARNING specified POWERSHELLEXE-Path does not exist or access denied!
|
||||||
|
ECHO Falling back to build in Powershell Version.
|
||||||
|
timeout /T 30
|
||||||
|
|
||||||
|
ECHO Running these scripts now:
|
||||||
|
FOR /F "tokens=*" %%f in ('dir /b %FILEEXTENSION%') do (
|
||||||
|
|
||||||
|
ECHO -
|
||||||
|
SET "SCRIPT=%%f"
|
||||||
|
ECHO Running script:
|
||||||
|
ECHO !SCRIPT!
|
||||||
|
|
||||||
|
ECHO -
|
||||||
|
SET "ARGUMENTS=-NoProfile -ExecutionPolicy Bypass -File \""!SCRIPT!\"""
|
||||||
|
ECHO With Arguments:
|
||||||
|
ECHO !ARGUMENTS!
|
||||||
|
|
||||||
|
ECHO -
|
||||||
|
SET "SUBCOMMAND=Start-Process -FilePath 'powershell.exe' -ArgumentList '!ARGUMENTS!' "
|
||||||
|
ECHO Subcommand:
|
||||||
|
ECHO !SUBCOMMAND!
|
||||||
|
|
||||||
|
ECHO -
|
||||||
|
IF !ADMINMODE! EQU 1 (
|
||||||
|
SET "COMMAND=Start-Process powershell.exe -Verb runas {!SUBCOMMAND!} "
|
||||||
|
) ELSE (
|
||||||
|
SET "COMMAND=Start-Process powershell.exe {!SUBCOMMAND!} "
|
||||||
|
)
|
||||||
|
ECHO In nested command:
|
||||||
|
ECHO !COMMAND!
|
||||||
|
|
||||||
|
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "!COMMAND!"
|
||||||
|
|
||||||
|
IF ERRORLEVEL 1 (
|
||||||
|
ECHO There was an error running the script: !SCRIPT! >> !LOGFILE!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
REM --------------------------------------------------------------
|
||||||
|
REM -------------------------final part---------------------------
|
||||||
|
REM --------------------------------------------------------------
|
||||||
|
|
||||||
|
ENDLOCAL
|
||||||
|
ECHO -
|
||||||
|
ECHO Program Complete %date% at %time:~0,8% o'clock, on %computername%.
|
||||||
ECHO This Window will close in:
|
ECHO This Window will close in:
|
||||||
#timeout /T 10
|
timeout /T 10
|
||||||
endlocal
|
|
||||||
exit
|
exit
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
System Requirements
|
||||||
|
|
||||||
|
- PowerShell Version 6 or higher needs to be installed
|
||||||
|
The path of the Powershell Exe needs to be set in the "Install-WindowsService_Caller.cmd" file.
|
||||||
|
Like: SET POWERSHELLEXE="C:\Program Files\PowerShell\7\pwsh.exe"
|
||||||
@ -45,6 +45,8 @@ LogFileKeepTime = 30
|
|||||||
####################################################################################################
|
####################################################################################################
|
||||||
# InstallServiceProfile #
|
# InstallServiceProfile #
|
||||||
# This profile type installs or updates existing services and starts them if needed. #
|
# This profile type installs or updates existing services and starts them if needed. #
|
||||||
|
# Updating a service can not overwrite the <FullPathToEXE>, in case a path needs to be changed, #
|
||||||
|
# uninstall and install the service again! #
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
# First Parameter: <ServiceDisplayName> #
|
# First Parameter: <ServiceDisplayName> #
|
||||||
# Set the service display name, you want to install. #
|
# Set the service display name, you want to install. #
|
||||||
@ -95,6 +97,15 @@ LogFileKeepTime = 30
|
|||||||
# Example: securepassword #
|
# Example: securepassword #
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
|
|
||||||
|
UninstallServiceProfile = DigitalDataEmail-Service
|
||||||
|
#InstallServiceProfile = Digital Data Email-Service ; D:\ProgramFiles\Digital Data\Debug\DDEmailService.exe ; ; Manual ; InstallAndStart ; Sends emails from the Digital Data email pool.
|
||||||
|
|
||||||
|
#Example:
|
||||||
|
#UninstallServiceProfile = MyNiceService
|
||||||
|
|
||||||
|
#InstallServiceProfile = My nice service ; D:\ProgramFiles\Myniceservice\program.exe ; ;Automatic ; InstallOnly ; This is a very nice service
|
||||||
|
#InstallServiceProfile = My nice service ; D:\ProgramFiles\Myniceservice\program.exe ; -parameter1 ;Automatic ; InstallAndStart ; This is a very nice service ; domain\user ; password
|
||||||
|
|
||||||
#UninstallServiceProfile = DigitalDataEB-Creator
|
#UninstallServiceProfile = DigitalDataEB-Creator
|
||||||
#UninstallServiceProfile = DigitalDataEmail-Profiler
|
#UninstallServiceProfile = DigitalDataEmail-Profiler
|
||||||
#UninstallServiceProfile = DigitalDataeInvoice-Parser
|
#UninstallServiceProfile = DigitalDataeInvoice-Parser
|
||||||
@ -103,17 +114,10 @@ LogFileKeepTime = 30
|
|||||||
#UninstallServiceProfile = DigitalDataWM-ResultHandler
|
#UninstallServiceProfile = DigitalDataWM-ResultHandler
|
||||||
#UninstallServiceProfile = DigitalDataEDMI-Service
|
#UninstallServiceProfile = DigitalDataEDMI-Service
|
||||||
|
|
||||||
InstallServiceProfile = Digital Data EB-Creator ; F:\ProgramFiles\Digital Data\DDEBCreator\SERVICE\EB_Creator.exe ; ; Manual ; InstallOnly ; Creates result reports for released documents.
|
#InstallServiceProfile = Digital Data EB-Creator ; D:\ProgramFiles\Digital Data\DDEBCreator\SERVICE\EB_Creator.exe ; ; Manual ; InstallOnly ; Creates result reports for released documents.
|
||||||
InstallServiceProfile = Digital Data Email-Profiler ; F:\ProgramFiles\Digital Data\DDEmailProfiler\SERVICE\EmailProfiler.Service.exe ; ; Manual ; InstallOnly ; Monitors email inboxes and processes incoming emails and their attachments.
|
#InstallServiceProfile = Digital Data Email-Profiler ; D:\ProgramFiles\Digital Data\DDEmailProfiler\SERVICE\EmailProfiler.Service.exe ; ; Manual ; InstallOnly ; Monitors email inboxes and processes incoming emails and their attachments.
|
||||||
InstallServiceProfile = Digital Data eInvoice-Parser ; F:\ProgramFiles\Digital Data\DDZUGFeRDService\DDZUGFeRDService.exe ; ; Manual ; InstallOnly ; Validates electronic invoices and extracts data.
|
#InstallServiceProfile = Digital Data eInvoice-Parser ; D:\ProgramFiles\Digital Data\DDZUGFeRDService\DDZUGFeRDService.exe ; ; Manual ; InstallOnly ; Validates electronic invoices and extracts data.
|
||||||
InstallServiceProfile = Digital Data JobRunner ; F:\ProgramFiles\Digital Data\DDJobRunner\SERVICE\DigitalData.Services.JobRunner.exe ; ; Manual ; InstallOnly ; Executes defined and configured jobs to synchronize master and transaction data.
|
#InstallServiceProfile = Digital Data JobRunner ; D:\ProgramFiles\Digital Data\DDJobRunner\SERVICE\DigitalData.Services.JobRunner.exe ; ; Manual ; InstallOnly ; Executes defined and configured jobs to synchronize master and transaction data.
|
||||||
InstallServiceProfile = Digital Data Email-Service ; F:\ProgramFiles\Digital Data\DDEmailService\SERVICE\DDEmailService.exe ; ; Manual ; InstallOnly ; Sends emails from the Digital Data email pool.
|
#InstallServiceProfile = Digital Data Email-Service ; D:\ProgramFiles\Digital Data\DDEmailService\SERVICE\DDEmailService.exe ; ; Manual ; InstallOnly ; Sends emails from the Digital Data email pool.
|
||||||
#InstallServiceProfile = Digital Data WM-ResultHandler ; ; ; Manual ; InstallOnly ; Executes windream searches and processes the results according to profile specifications.
|
#InstallServiceProfile = Digital Data WM-ResultHandler ; ; ; Manual ; InstallOnly ; Executes windream searches and processes the results according to profile specifications.
|
||||||
#InstallServiceProfile = Digital Data EDMI-Service ; ; ; Manual ; InstallOnly ; Proxy Service for Digital Data Applications.
|
#InstallServiceProfile = Digital Data EDMI-Service ; ; ; Manual ; InstallOnly ; Proxy Service for Digital Data Applications.
|
||||||
|
|
||||||
|
|
||||||
#Example:
|
|
||||||
#UninstallServiceProfile = MyNiceService
|
|
||||||
|
|
||||||
#InstallServiceProfile = My nice service ; D:\ProgramFiles\Myniceservice\program.exe ; ;Automatic ; InstallOnly ; This is a very nice service
|
|
||||||
#InstallServiceProfile = My nice service ; D:\ProgramFiles\Myniceservice\program.exe ; -parameter1 ;Automatic ; InstallAndStart ; This is a very nice service ; domain\user ; password
|
|
||||||
Loading…
x
Reference in New Issue
Block a user