-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

Showing posts with label secdevops. Show all posts
Showing posts with label secdevops. Show all posts
  • windows-backup-script-batch-scripting

     

     

    windows-backup-script-batch-scripting

     

    Windows Backup Script in Batch Scripting | Automatically Backup Your Files


    Creating regular backups is one of the best ways to protect important files from accidental deletion, hardware failure, or system issues. Instead of manually copying files every time, you can automate the process using a simple Batch Script.

    In this tutorial, we'll create a Windows Backup Script that automatically copies the Documents folder to a backup location.


    Batch Script

     

    @echo off
    
    set BackupFolder=C:\
    
    Backup if not exist "%BackupFolder%" (
    
    mkdir "%BackupFolder%"
    
    )
    
    xcopy "%USERPROFILE%\Documents" "%BackupFolder%\Documents" /E /I /Y
    
    echo Backup Completed Successfully.
    pause
    

     

     

    How the Script Works


    Step 1: Turn Off Command Display

    @echo off


    This hides the commands while the script is running, making the output easier to read.


    Step 2: Set the Backup Folder

    set BackupFolder=C:\Backup

    This creates a variable named BackupFolder and stores the destination path where the backup will be saved.


    Step 3: Check Whether the Folder Exists

    The script checks if the backup folder already exists.

    • If it exists, the script continues.
    • If it doesn't exist, a new folder named Backup is created automatically.


    Step 4: Copy the Documents Folder


    xcopy "%USERPROFILE%\Documents" "%BackupFolder%\Documents" /E /I /Y

    The xcopy command copies the contents of the Documents folder to the backup location.


    XCOPY Options


    windows-backup-script-batch-scripting

     

     The %USERPROFILE% environment variable automatically points to the current user's profile folder.



    Step 5: Display Success Message

    echo Backup Completed Successfully.
    This lets the user know that the backup process has finished.


    Step 6: Pause the Window

    pause
    Keeps the Command Prompt window open until a key is pressed.


    Sample Output


    Backup Completed Successfully.

    Press any key to continue . . .


     

    Why Use a Windows Backup Script?


    Automating backups offers several benefits:

    • Saves time
    • Protects important files
    • Reduces manual work
    • Creates a consistent backup routine
    • Improves data safety



    Real-World Uses


    System Engineers and IT Support Engineers often use backup scripts to:

    • Backup user documents before system upgrades
    • Protect important company files
    • Create scheduled backups
    • Prepare systems before maintenance
    • Copy project files to a secure location



    Tips


    Change the backup location if needed. For example:


    D:\Backup

    or

    E:\OfficeBackup

    You can also replace the Documents folder with other folders such as:

    • Desktop
    • Downloads
    • Pictures
    • Project folders




    Interview Questions


    What is the purpose of the xcopy command?

    • It copies files and folders from one location to another.


    What does %USERPROFILE% represent?

    • It is an environment variable that points to the current user's profile directory.


    Why is if not exist used?

    • It checks whether a folder exists before creating it.


    What does the /Y option do in xcopy?

    • It overwrites existing files without prompting for confirmation.


    Why should System Engineers automate backups?

    • Automation saves time, reduces human error, and ensures important files are backed up consistently.




    Conclusion


    A Windows Backup Script is a simple yet practical Batch Scripting project that automates one of the most important maintenance tasks—backing up files. By using commands like if not exist, mkdir, and xcopy, you can quickly create reliable backup scripts for personal or professional use.

    If you're learning Batch Scripting for a career in IT Support or System Engineering, this is an excellent project to practice and include in your portfolio.

     

     

  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.