1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
| @echo off
setlocal enabledelayedexpansion
Set "Delay2Shutdown=600"
Set "Delay2Reboot=600"
Set TmpFile=%Temp%\TmpFile.txt
Set Resultat=%Temp%\KillResult.txt
Set "MyKey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"
If Exist %TmpFile% Del %TmpFile%
If Exist %Resultat% Del %Resultat%
Set "MyFile=%~f0"
Set "ShorcutName=Shtutdown_Reboot"
(
echo Call Shortcut("%MyFile%","%ShorcutName%"^)
echo ^'**********************************************************************************************^)
echo Sub Shortcut(CheminApplication,Nom^)
echo Dim objShell,DesktopPath,objShortCut,MyTab
echo Set objShell = CreateObject("WScript.Shell"^)
echo MyTab = Split(CheminApplication,"\"^)
echo If Nom = "" Then
echo Nom = MyTab(UBound(MyTab^)^)
echo End if
echo DesktopPath = objShell.SpecialFolders("Desktop"^)
echo Set objShortCut = objShell.CreateShortcut(DesktopPath ^& "\" ^& Nom ^& ".lnk"^)
echo objShortCut.TargetPath = Dblquote(CheminApplication^)
echo ObjShortCut.IconLocation = "Shell32.dll,44"
echo objShortCut.Save
echo End Sub
echo ^'**********************************************************************************************
echo ^'Fonction pour ajouter les doubles quotes dans une variable
echo Function DblQuote(Str^)
echo DblQuote = Chr(34^) ^& Str ^& Chr(34^)
echo End Function
echo ^'**********************************************************************************************
) > %temp%\Shortcutme.vbs
Start /Wait %temp%\Shortcutme.vbs
Del %temp%\Shortcutme.vbs
::****************************************************************************************************
Title Dynamic Menu (Shutdown/Reboot) (Start/Kill Process) by Hackoo 2016
:menuLOOP
Color 1E & Mode con cols=78 lines=20
echo(
echo( =============================Menu==============================
echo(
for /f "tokens=2* delims=_ " %%A in ('"findstr /b /c:":menu_" "%~f0""') do echo %%A %%B
echo(
echo( ===============================================================
set choice=
echo( & set /p choice=Make a choice or hit ENTER to quit: || GOTO :EOF
echo( & call :menu_[%choice%]
GOTO:menuLOOP
::********************************************************************************************
:menu_[1] (ARRET)/(SHUTDOWN)
cls & color 0A
Call:SkipLine 5
Call:Tab 3
echo %x% Please Wait for a while ....
TimeOut /T 1 /NoBreak>nul
shutdown -s -t %Delay2Shutdown% -c "Your machine will shutdown in 5 minutes." -f
GOTO:menuLOOP
::********************************************************************************************4
:menu_[2] (REDEMARRAGE)/(REBOOT)
cls & color 0A
Call:SkipLine 5
Call:Tab 3
echo %x% Please Wait for a while .....
TimeOut /T 1 /NoBreak>nul
shutdown -r -t %Delay2Reboot% -c "Your machine will reboot in 5 minutes." -f
GOTO:menuLOOP
::********************************************************************************************
:menu_[3] (APPLICATION PAS DE REPONSE)/(APPLICATION NOT RESPONDING)
cls & color 0A
Call:SkipLine 10
Call:Tab 3
echo %x% Please Wait for a while .. Launching ...
TimeOut /T 1 /NoBreak>nul
Start "Killing not responding application" cmd /k taskkill.exe /f /fi "status eq not responding" >> %Resultat%
GOTO:menuLOOP
::********************************************************************************************
:menu_[4] (ANNULER ARRET/REDEMARRAGE)/(CANCEL SHUTDOWN/REBOOT)
cls & color 0A
Call:SkipLine 5
Call:Tab 7
echo %x% Please Wait for a while ....
TimeOut /T 1 /NoBreak>nul
(
echo Set Ws = CreateObject("wscript.shell"^)
echo Answ = MsgBox("Did you want to cancel the scheduled reboot of your the computer ?"_
echo ,VbYesNo+VbQuestion,"Did you want to cancel the scheduled reboot of your the computer ?"^)
echo If Answ = VbYes then
echo Return = Ws.Run("cmd /c Shutdown -a",0,True^)
echo Else
echo wscript.Quit(1^)
echo End If
)>"%tmp%\%~n0.vbs"
Start "" "%tmp%\%~n0.vbs"
GOTO:menuLOOP
::********************************************************************************************
:menu_[5] (START PROCESS/MULTI-PROCESS)/(LANCER PROSESSUS)
cls & color 0A
echo(
echo Enter the process name or processes names separated by a space
echo(
Set /p "MyProcess=What process(es) do you want to Start ?>"
cls
Call:SkipLine 8
Call:Tab 6
echo %x% The process(es) "%MyProcess%" is launched ...
TimeOut /T 1 /NoBreak>nul
For %%a in (%Myprocess%) Do (Start %%a)
GOTO :menuLOOP
::********************************************************************************************
:menu_[6] (KILL PROCESS/MULTI-PROCESS)/(TUER PROCESSUS)
Title Process Killer by Hackoo 2016
cls & color 0B
echo(
echo Enter the process name or processes names separated by a space
echo(
set /p "process=What process(es) do you want to kill ?>"
cls & color 0C
Title Killing "%process%" ...
Call:SkipLine 8
Call:Tab 7
echo %x% Killing "%process%" ...
echo(
echo %date% *** %time% >> %TmpFile%
For %%a in (%process%) Do Call :KillMyProcess %%a
Cmd /U /C Type %TmpFile% > %Resultat%
Start %Resultat%
GOTO :menuLOOP
::******************************************************************************************
:menu_[7] (Disable execution for one application choosen by the user)
Mode con cols=90 lines=15 & Cls & color 0C
echo(
echo Enter Application name with its extension to block and disable it like "Chrome.exe"
echo(
Set /p "App=Enter Application name to block and diable it > "
IF [%App%] == [] GOTO:menuLOOP
REG ADD "%MyKey%\%App%" /f
REG ADD "%MyKey%\%App%" /v Debugger /t REG_SZ /d Block /f
Start "" "%App%"
GOTO:menuLOOP
::*****************************************************************************************
:menu_[8] (Enable execution for one application choosen by the user)
Mode con cols=90 lines=15 & Cls & color 0A
echo(
echo Enter Application name with its extension to unblock and enable it like "Chrome.exe"
echo(
Set /p "App=Enter Application name to unblock and enable it> "
IF [%App%] == [] GOTO:menuLOOP
REG ADD "%MyKey%\%App%" /f
REG ADD "%MyKey%\%App%" /v Debugger /t REG_SZ /d "" /f
Start "" "%App%"
GOTO:menuLOOP
::*****************************************************************************************
:menu_[9] (Disable and block the execution of all Browsers)
Mode con cols=90 lines=15 & Cls & color 0C
Set Browsers=iexplore.exe firefox.exe chrome.exe opera.exe
For %%a in (%Browsers%) Do Call :BlockExecution %%a
GOTO:menuLOOP
::*****************************************************************************************
:menu_[10] Enable and unblock the execution of all Browsers)
Mode con cols=90 lines=15 & Cls & color 0A
Set Browsers=iexplore.exe firefox.exe chrome.exe opera.exe
For %%a in (%Browsers%) Do Call :UnBlockExecution %%a
GOTO:menuLOOP
::********************************************************************************************
:menu_[11] Take screenshots of your applications (Windows 7,8,10)
Start "" snippingtool.exe
GOTO :menuLOOP
::*****************************************************************************************
:BlockExecution
REG ADD "%MyKey%\%~nx1" /f
REG ADD "%MyKey%\%~nx1" /v Debugger /t REG_SZ /d Block /f
Exit /b
::*****************************************************************************************
:UnBlockExecution
REG ADD "%MyKey%\%~nx1" /f
REG ADD "%MyKey%\%~nx1" /v Debugger /t REG_SZ /d "" /f
Exit /b
::*****************************************************************************************
:Tab
set "x="
For /L %%I In (1,1,%1) Do Set "x=!x! "
REM ^-- this is a TAB
goto :eof
::*********************************************************************************************
:SkipLine
For /L %%I In (1,1,%1) Do Echo(
Goto:Eof
::*********************************************************************************************
:KillMyProcess
Taskkill /IM "%~n1.exe" /F >> %TmpFile% 2>&1
echo ***************************************************************************** >> %TmpFile%
exit /b
::***************************************************************************************** |
Partager