Étape 4: Remplir les fonctions
Maintenant nous allons remplir eux ! Insérez le code ci-dessous sous le le dernier écho avec---
:aboutecho This batch file was created by Kevin Tipker in June 2016echo and is free to use and modify on your own risk. Please be very echo carefull if you don't understand what you are doing echo. echo You can find more of my work in the link below. echo -
:Help echo * To run this bat file without any problems you need to be a Administratorecho and execute it as Administrator echo. echo 1. Generate Backup of Files (enter 7 to see information) echo - Check if there is a map called Backup in C:/ If not create it echo. echo 2. Check Network Connectivity echo - Make sure to use LAN echo. echo 4. Deletes Temporary Internet Files, History and Cookies echo - The history, cookies etc files are located in echo C:\Documents and Settings\username\Local Settings\Temporary Internet Files
:BackupInfo echo This process will make a backup of the following files:echo - My Documents echo - Favorites echo - Email and contacts (MS Outlook) echo - Backing up email and address book (Outlook Express) echo - Registry echo. echo * NOTE: There is a change that not everything will be backed up echo and that is because you maybe not have MS Oulook or Outlook Express
:CreateBackup :: variables::this has to be above the title rule (see image 5)set drive=C:\Backup set backupcmd=xcopy /s /c /d /e /h /i /r /yecho - Backing up My Documents...%backupcmd% "%USERPROFILE%\My Documents" "%drive%\My Documents"echo - Backing up Favorites... %backupcmd% "%USERPROFILE%\Favorites" "%drive%\Favorites"echo - Backing up email and address book (Outlook Express)... %backupcmd% "%USERPROFILE%\Application Data\Microsoft\Address Book" "%drive%\Address Book" %backupcmd% "%USERPROFILE%\Local Settings\Application Data\Identities" "%drive%\Outlook Express"echo - Backing up email and contacts (MS Outlook)... %backupcmd% "%USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook" "%drive%\Outlook"echo - Backing up the Registry... if not exist "%drive%\Registry" mkdir "%drive%\Registry" if exist "%drive%\Registry\regbackup.reg" del "%drive%\Registry\regbackup.reg" regedit /e "%drive%\Registry\regbackup.reg"echo. echo Backup Complete!
:CheckNetworkConn ping -n 1 www.google.com >nul off IF NOT ERRORLEVEL 1 goto :SUCCESS IF ERRORLEVEL 1 goto :TRYAGAIN
:TRYAGAIN echo - Let me try a bit more, please wait... off ping -n 1 www.google.com >nul IF NOT ERRORLEVEL 1 goto :SUCCESS2 IF ERRORLEVEL 1 goto :TRYIP
:TRYIP echo - Checking DNS...echo - Lets try by IP address... off ping -n 1 216.239.37.99|find "Reply from " >NUL IF NOT ERRORLEVEL 1 goto :SUCCESSDNS IF ERRORLEVEL 1 goto :TRYROUTER
:TRYROUTER echo - Lets try pinging the router....ping -n 2 192.168.1.1|find "Reply from " >NUL IF NOT ERRORLEVEL 1 goto :ROUTERSUCCESS IF ERRORLEVEL 1 goto :NETDOWN
:ROUTERSUCCESS echo - It appears that you can reach the router, but internet is unreachable.
:NETDOWN echo - It appears that you having network issues, the router cannot be reached.
:SUCCESSDNS echo - It appears that you are having DNS issues.
:SUCCESS echo - You have an active Internet connection
:SUCCESS2 echo - You have an active internet connection but some packet loss was detected.
:FAILURE echo - You do not have an active Internet connection
:ShowServices echo - ActiveX Installer (AxInstSV)echo - BitLocker Drive Encryption Service echo - Printer Extensions and Notifications echo - Print Spooler echo - Optimize Drives echo - http service (for problems with localhost servers like XAMP)
:CloseSomeServices ::You can add diffrent services here just search them up on google net stop AxInstSVnet stop BDESVC net stop PrintNotify net stop Spooler net stop defragsvc net stop http
:DeleteCache ::This is not everything you can use there are some more that you can use to delete internet files from your pc echo - Starting process...RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1 echo - Done!
:GetComputerInfo REM set variablesset system= set manufacturer= set model= set serialnumber= set osname= set sp= setlocal ENABLEDELAYEDEXPANSION set "volume=C:" set totalMem= set availableMem= set usedMem=echo Getting data [Computer: %computername%]... echo Please Wait....REM Get Computer Name FOR /F "tokens=2 delims='='" %%A in ('wmic OS Get csname /value') do SET system=%%AREM Get Computer Manufacturer FOR /F "tokens=2 delims='='" %%A in ('wmic ComputerSystem Get Manufacturer /value') do SET manufacturer=%%AREM Get Computer Model FOR /F "tokens=2 delims='='" %%A in ('wmic ComputerSystem Get Model /value') do SET model=%%AREM Get Computer Serial Number FOR /F "tokens=2 delims='='" %%A in ('wmic Bios Get SerialNumber /value') do SET serialnumber=%%AREM Get Computer OS FOR /F "tokens=2 delims='='" %%A in ('wmic os get Name /value') do SET osname=%%A FOR /F "tokens=1 delims='|'" %%A in ("%osname%") do SET osname=%%AREM Get Computer OS SP FOR /F "tokens=2 delims='='" %%A in ('wmic os get ServicePackMajorVersion /value') do SET sp=%%AREM Get Memory FOR /F "tokens=4" %%a in ('systeminfo ^| findstr Physical') do if defined totalMem (set availableMem=%%a) else (set totalMem=%%a) set totalMem=%totalMem:,=% set availableMem=%availableMem:,=% set /a usedMem=totalMem-availableMemFOR /f "tokens=1*delims=:" %%i IN ('fsutil volume diskfree %volume%') DO ( SET "diskfree=!disktotal!" SET "disktotal=!diskavail!" SET "diskavail=%%j" ) FOR /f "tokens=1,2" %%i IN ("%disktotal% %diskavail%") DO SET "disktotal=%%i"& SET "diskavail=%%j"echo. echo ----------------------------------------------------------------- echo Computer Information echo ----------------------------------------------------------------- echo - System Name: %system% echo - Manufacturer: %manufacturer% echo - Model: %model% echo - Serial Number: %serialnumber% echo - Operating System: %osname% echo - C:\ Total: %disktotal:~0,-9% GB echo - C:\ Avail: %diskavail:~0,-9% GB echo - Total Memory: %totalMem% echo - Used Memory: %usedMem% echo - Computer Processor: %processor_architecture% echo - Service Pack: %sp% echo -----------------------------------------------------------------