Showing posts with label Batch File. Show all posts
Showing posts with label Batch File. Show all posts

Friday, 27 August 2021

Wednesday, 29 August 2018

Command Line - Close Chrome From Bat File

taskkill /IM chrome.exe /F

Shut Down The Computer With a Batch File

shutdown.exe /s /t 00

Restart The Computer With a Batch File

shutdown.exe /r /t 00

Batch Script To Automatically Reload explorer.exe

taskkill /IM explorer.exe /F
start explorer.exe

Batch File To Open Credential Manager

@echo off
START /min rundll32.exe keymgr.dll,KRShowKeyMgr
exit

Copy Files From One Folder To Another?

xcopy /s D:\ C:\Users\TEST_104_2\Desktop\

Batch File To Delete Temporary Files Windows 10

@ECHO off 
DEL /F /S /Q %TEMP%

cd C:\Users\%username%\AppData\Local
 rmdir /S /Q Temp

del C:\Windows\Prefetch\*.* /Q

del C:\Windows\Temp\*.* /Q

del C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Recent Items*.* /Q

Connect To SVN Command Batch File

CMD /c nslookup SERVER.ABC.local
CMD /c pathping SERVER.ABC.local

pause

Batch File To Clear ALL Browsers Cookies & History

@echo off

rem IE
taskkill /F /IM iexplore.exe
start "" "C:\Windows\System32\rundll32.exe" InetCpl.cpl,ClearMyTracksByProcess  255

:: Parse the Local AppData sub path
call :Expand xAppData "%%LocalAppData:%UserProfile%=%%"

set "xFirefox=\mozilla\firefox\profiles"
set "xChrome=\google\chrome\user data"

:: Start at the User directory
pushd "%UserProfile%\.."

taskkill /F /IM firefox.exe
taskkill /F /IM chrome.exe

:: Loop through the Users
    for /D %%D in (*) do if exist "%%~fD%xAppData%" (
    rem Check for Firefox
    if exist "%%~fD%xAppData%%xFirefox%" (
        rd /s /q "%%~fD%xAppData%%xFirefox%"
    )

   rem Check for Chrome
   if exist "%%~fD%xAppData%%xChrome%" (
        rd /s /q "%%~fD%xAppData%%xChrome%"
    )
)
popd
goto End


::::::::::::::::::::::::::::::
:Expand <Variable> <Value>
if not "%~1"=="" set "%~1=%~2"
goto :eof


:End
endlocal

Adding Login Information To The Credential Manager

echo off
cmdkey /add:server /user:sarin /pass:123
pause