Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM @ECHO OFF
- Setlocal EnableDelayedExpansion enableextensions
- CLS
- :START
- REM Set the current directory to the batch file location
- REM Directory may change after elevation
- cd /d %~dp0
- ECHO Adding toolkit\tools to path and setting base variables
- ECHO.
- REM Ensuring variables are unset can help stop weird problems,
- REM but more importantly this section serves as a list of all variables used in the script
- REM All variables start with TK to avoid variable clash, and because starting variables with a number causes problems
- REM
- REM If you want to change where the Toolkit installs to, or have it run in the current folder, change this
- SET TK=%temp%\toolkit
- REM If you want to pause after each step (if it fails to run properly, for example), set tkpause to YES
- SET TKPAUSE=NO
- REM TKDLFN Toolkit download filename - temp variable
- SET "TKDLFN="
- REM TKDLFN2 Toolkit download function - If a file specified with TKDLFS
- REM is found, this contains the last found example, if any - temp variable
- SET "TKDLFN2="
- REM TKDLFS Toolkit Download function: File name search
- REM If this is set to a file name, like wget.exe, that file name
- REM will be searched for on the entire C: drive - temp variable
- SET "TKDLFS="
- REM TKDLURL Toolkit download url - temp variable
- SET "TKDLURL="
- REM TKDLPATH Toolkit download path - temp variable
- SET "TKDLPATH="
- REM TKSEC Toolkit section to return to - temp variable
- SET "TKSEC="
- REM TKPSVER Powershell version - automatically set
- SET TKPSVER=0
- REM Windows 32/64 - automatically set
- SET "TKWIN="
- REM Command prompt executable 32/64 - automatically set
- SET "TKCMD="
- REM System32/SysWOW64 - automatically set
- SET "TKSYS32="
- REM Powershell.exe path - automatically set
- SET "TKPSEXE="
- REM 7Zip Path - automatically set
- SET "TK7Z="
- REM Backup PHPRC variable - automatically set
- SET "PHPRCBAK=%PHPRC%"
- REM Backup PHPINI variable - automatically set
- SET "PHPINIBAK=%PHPINI%"
- REM Portable Chromium path - temp variable
- SET "TKCHROME="
- REM Add Toolkit Tools folder to path
- SET PATH=%PATH%;%TK%\tools
- ECHO Set 32/64 bit variables
- IF NOT EXIST %WINDIR%\sysnative\cmd.exe (
- ECHO It's either 64 on 64 or 32 on 32
- if EXIST "%PROGRAMFILES(X86)%" (
- echo 64 bit CMD on 64 bit Windows
- set "TKWIN=X64"
- set "TKCMD=X64"
- set "TKSYS32=SYSWOW64"
- ) else (
- echo 32 bit CMD on 32 bit Windows
- set "TKWIN=X86"
- set "TKCMD=X86"
- set "TKSYS32=SYSTEM32"
- )
- ) else (
- echo 32 bit CMD on 64 bit Windows
- set "TKWIN=X64"
- set "TKCMD=X86"
- set "TKSYS32=SYSWOW64"
- )
- ECHO.
- set TKCHROME2=C:\\Users\\TESTBE~1\\AppData\\Local\\Temp\\toolkit\\chrome-win32\\chrome.exe
- REM set TKCHROME2=C:/windows/notepad.exe
- FOR /F "tokens=* USEBACKQ" %%F IN (`wmic process where ExecutablePath^="!TKCHROME2!" get ProcessID /FORMAT:TABLE`) DO (
- IF %%F GEQ 1 (
- ECHO F IS %%F
- ECHO TK IS %TK%
- ECHO TK2 IS !TK!
- ECHO "%TK%\tools\pskill.exe" -t -nobanner %%F
- ECHO "!TK!\tools\pskill.exe" -t -nobanner %%F
- "%TK%\tools\pskill.exe" -t -nobanner %%F
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement