Advertisement
Guest User

Untitled

a guest
Sep 21st, 2016
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.97 KB | None | 0 0
  1. REM @ECHO OFF
  2. Setlocal EnableDelayedExpansion enableextensions
  3. CLS
  4.  
  5. :START
  6. REM Set the current directory to the batch file location
  7. REM Directory may change after elevation
  8. cd /d %~dp0
  9.  
  10. ECHO Adding toolkit\tools to path and setting base variables
  11. ECHO.
  12. REM Ensuring variables are unset can help stop weird problems,
  13. REM but more importantly this section serves as a list of all variables used in the script
  14. REM All variables start with TK to avoid variable clash, and because starting variables with a number causes problems
  15. REM
  16. REM If you want to change where the Toolkit installs to, or have it run in the current folder, change this
  17. SET TK=%temp%\toolkit
  18. REM If you want to pause after each step (if it fails to run properly, for example), set tkpause to YES
  19. SET TKPAUSE=NO
  20. REM TKDLFN Toolkit download filename - temp variable
  21. SET "TKDLFN="
  22. REM TKDLFN2 Toolkit download function - If a file specified with TKDLFS
  23. REM is found, this contains the last found example, if any - temp variable
  24. SET "TKDLFN2="
  25. REM TKDLFS Toolkit Download function: File name search
  26. REM If this is set to a file name, like wget.exe, that file name
  27. REM will be searched for on the entire C: drive - temp variable
  28. SET "TKDLFS="
  29. REM TKDLURL Toolkit download url - temp variable
  30. SET "TKDLURL="
  31. REM TKDLPATH Toolkit download path - temp variable
  32. SET "TKDLPATH="
  33. REM TKSEC Toolkit section to return to - temp variable
  34. SET "TKSEC="
  35. REM TKPSVER Powershell version - automatically set
  36. SET TKPSVER=0
  37. REM Windows 32/64 - automatically set
  38. SET "TKWIN="
  39. REM Command prompt executable 32/64 - automatically set
  40. SET "TKCMD="
  41. REM System32/SysWOW64 - automatically set
  42. SET "TKSYS32="
  43. REM Powershell.exe path - automatically set
  44. SET "TKPSEXE="
  45. REM 7Zip Path - automatically set
  46. SET "TK7Z="
  47. REM Backup PHPRC variable - automatically set
  48. SET "PHPRCBAK=%PHPRC%"
  49. REM Backup PHPINI variable - automatically set
  50. SET "PHPINIBAK=%PHPINI%"
  51. REM Portable Chromium path - temp variable
  52. SET "TKCHROME="
  53. REM Add Toolkit Tools folder to path
  54. SET PATH=%PATH%;%TK%\tools
  55.  
  56. ECHO Set 32/64 bit variables
  57. IF NOT EXIST %WINDIR%\sysnative\cmd.exe (
  58.     ECHO It's either 64 on 64 or 32 on 32
  59.     if EXIST "%PROGRAMFILES(X86)%" (
  60.         echo 64 bit CMD on 64 bit Windows
  61.         set "TKWIN=X64"
  62.         set "TKCMD=X64"
  63.         set "TKSYS32=SYSWOW64"
  64.     ) else (
  65.         echo 32 bit CMD on 32 bit Windows
  66.         set "TKWIN=X86"
  67.         set "TKCMD=X86"
  68.         set "TKSYS32=SYSTEM32"
  69.     )
  70. ) else (
  71.     echo 32 bit CMD on 64 bit Windows
  72.     set "TKWIN=X64"
  73.     set "TKCMD=X86"
  74.     set "TKSYS32=SYSWOW64"
  75. )
  76. ECHO.
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. set TKCHROME2=C:\\Users\\TESTBE~1\\AppData\\Local\\Temp\\toolkit\\chrome-win32\\chrome.exe
  84. REM set TKCHROME2=C:/windows/notepad.exe
  85. FOR /F "tokens=* USEBACKQ" %%F IN (`wmic process where ExecutablePath^="!TKCHROME2!" get ProcessID /FORMAT:TABLE`) DO (
  86.     IF %%F GEQ 1 (
  87.     ECHO F IS %%F
  88.             ECHO TK IS %TK%
  89.         ECHO TK2 IS !TK!
  90.         ECHO "%TK%\tools\pskill.exe" -t -nobanner %%F
  91.         ECHO "!TK!\tools\pskill.exe" -t -nobanner %%F
  92.         "%TK%\tools\pskill.exe" -t -nobanner %%F
  93.     )
  94. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement