8
0
Skriptentwickung/archive/Get-WebDAVFiles/Get-WebDAVFiles_Caller.cmd
2024-01-24 16:42:38 +01:00

45 lines
1.4 KiB
Batchfile

@ECHO OFF
TITLE DIGITAL DATA - Run all files in directory with current permissions
ECHO -
ECHO Batch Script
ECHO Run all files in directory with current permissions
ECHO -
ECHO Digital Data
ECHO Ludwig-Rinn-Strasse 16
ECHO 35452 Heuchelheim
ECHO Tel.: 0641 / 202360
ECHO E-Mail: info@didalog.de
ECHO -
ECHO Version 1.0.0.0
ECHO Date: 13.08.2015
ECHO -
ECHO Program Startup %date% at %time:~0,8% oclock, on %computername%.
REM --------------------------------------------------------------
REM ------------------------set variables-------------------------
REM --------------------------------------------------------------
setlocal enableextensions
SET DIRECTORY="%cd%"
SET FILEEXTENSION=*.ps1
SET COUNT=0
REM --------------------------------------------------------------
REM ---------------------Program 1 / Script 1---------------------
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 Running this/them now, with your permissions!
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (PowerShell.exe -Command "& {Start-Process PowerShell.exe -WindowStyle hidden '-ExecutionPolicy Bypass -File "%%f"'}")
ECHO -
ECHO This Window will close in:
#timeout /T 10
endlocal
exit