Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to create an Automatic Backup from One Folder to Another Folder
- BackUp.bat
- robocopy "Folder A" "Folder B" /E
- robocopy "Folder A" "Folder B" /E /MIR
- robocopy "Folder A" "Folder B" /MIR + /E
- robocopy "Folder A" "Folder B" /E /MIR /COPYALL /ZB /R:5 /W:8
- robocopy "Folder A" "Folder B" /E /COPYALL /ZB /R:5 /W:8 /MOVE
- robocopy "Folder A" "Folder B" /E /COPYALL /ZB /R:5 /W:8 /MOVE /MOT:1
- --------------------------------------------------------------
- This time instead of xcopy, we are using robocopy. Robocopy is the upgraded form of xcopy. Save the batch file with any name but don't keep the name as robocopy because it crashes the robocopy system.
- /E This can copy all the files including subdirectories and empty directories.
- /MIR can copy all the files including subdirectories and empty directories, delete destination files and directories that no longer exist in the source, and using the /MIR + /E option can overwrite the destination directory security settings.
- /COPYALL copies file information such as data, attributes, time stamps, NTFS access control list, Owner information, and Auditing information.
- /ZB copies files in restartable mode. If file access is denied, it switches to backup mode.
- /R:5 retries five times if runs into any issues.
- /W:8 waits for 8 seconds between each of those (/R:5) five retries.
- /COPYALL and /ZB require to run as administrator.
- Delete /MIR and add /MOV. We cannot use /MIR with /MOV and /MOVE.
- /MOV can move the files but it will leave the source folder and subfolders empty after the files are moved. This can be pretty handy if you have assigned subfolders.
- /MOVE moves the files and subdirectories completely to the destination folder and the source folder gets deleted.
- Using /MOT:1 together with /MOVE can help us to retain only the source after the files are moved to the destination. This can be useful if someone doesn't want to retain files and empty subfolders in the source.
- The actual function of /MOT:1 is to monitor the source and run again in 1 minute if changes are detected.
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- BackUp.bat
- xcopy "SOURCE" "DESTINATION" /Y /E /D /C /F /H /I /Z /J
- ---------------------------------------------------------------------------------
- RunBat.vbs
- Set WshShell = CreateObject("WScript.Shell" )
- WshShell.Run chr(34) & "C:\Users\Najeeb\Desktop\BackUp.bat" & Chr(34), 0
- Set WshShell = Nothing
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- BackUps.bat
- xcopy "SOURCE" "DESTINATION" /Y /E /D /C /F /H /I /Z /J /S /K /R /G
- xcopy "SOURCE2" "DESTINATION2" /Y /E /D /C /F /H /I /Z /J /S /K /R /G
- xcopy "SOURCE3" "DESTINATION3" /Y /E /D /C /F /H /I /Z /J /S /K /R /G
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- How to create an automated task using Task Scheduler on Windows 7
- --------------------------------------------------------------------------------
- WIN+R =Run Commmad :-Taskschd.msc
- 1-Open Task Scheduler Click Action Menu Select Create Task = Name (Name of Task)=EXM:-(NajeebBackUp)OR (EmptyRecycleBin)
- 2-Click Triggers And Select New (New Trigger Win) Check Daily ; And Check (Repeat task every: and Chosse hour and mints)
- 3-Click Actions And Select New (New Action Win) Program/Script: ( wscript.exe ) Or (CMD.exe) And
- Add arguments(optional): ("C:\Users\Najeeb\Desktop\Run.vbs") Or (/c "echo Y|PowerShell.exe -NoProfile -Command Clear-RecycleBin")
- 4-Click condditions And Power UnCheck 1-(Stop if the Computer swiches to bettery power)
- 2-(start the task only if the computer is on AC power
- 5-Click Settings Check (Run task as soon as possible after a scheduled start is missed
- 6 Ok Finished
- -------------------------------------------------------------------------------
- How to Empty Recycle Bin Automatically in windows 7&10. It is very easy.
- Code:
- cmd.exe
- /c "echo Y|PowerShell.exe -NoProfile -Command Clear-RecycleBin"
- OR
- C:\Windows\nircmd.exe
- emptybin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement