Faruque Ahmed : MCP, MCSA, MCSE, MCTS, MCIT, CCNA, OCA, OCP, GCP
Double-click this New Text Document to open your default text editor. Copy and paste the following code into your text entry.
------------------@echo offtitle This is your first batch script!echo Welcome to batch scripting!pause ----------------batch to copy from network drive to C: or D: drive
----------------echo offclscopy "\\192.168.80.85\sh\*" D:\bk -----OR-------------echo offclsecho Would you like to do a backup?pausecopy "\\192.168.80.85\sh\*" D:\bkpauseOR
robocopy \\192.168.0.250\PublicShare\temp \\192.168.0.58\WorkD /e /copy:DAT /mt /z
Robocopy Incremental Sync
robocopy \\192.168.0.250\PublicShare\temp \\192.168.0.58\WorkD /e /copy:DAT /mt /z /xc /xn /xo
create a batch file, and put this code in it after the @echo off line:
@echo offshutdown -s -t 1800The computer will shut down 30 minutes (1800 seconds) after running the batch file.
To cancel a shutdown initiated by that batch file, you can go to Start → Run and type:
shutdown -a
shut down after 1 hour
shutdown -s -t 3600
Press the Windows key + S simultaneously. Type “cmd” or “command prompt” and select Run as administrator.
Type or paste the command del /q/f/s %TEMP%\ into the dialogue and press Enter.del %TEMP%\*.* /f /s /q
----------------
@ECHO OFFdel /s /f /q %userprofile%\Recent\*.*del /s /f /q C:\Windows\Prefetch\*.*del /s /f /q C:\Windows\Temp\*.*del /s /f /q %USERPROFILE%\appdata\local\temp\*.*------Clean up temp directory automatically in Windows 10
@echo off del "%tmp%\*.*" /s /q /f FOR /d %%p IN ("%tmp%\*.*") DO rmdir "%%p" /s /q---------
@echo offdel /s /f /q c:\windows\temp\*.*rd /s /q c:\windows\tempmd c:\windows\tempdel /s /f /q C:\WINDOWS\Prefetchdel /s /f /q %temp%\*.*rd /s /q %temp%md %temp%deltree /y c:\windows\tempor~1deltree /y c:\windows\tempdeltree /y c:\windows\tmpdeltree /y c:\windows\ff*.tmpdeltree /y c:\windows\historydeltree /y c:\windows\cookiesdeltree /y c:\windows\recentdeltree /y c:\windows\spool\printersdel c:\WIN386.SWPcls--------------------------