Creat script to perform a task.

Posted on 2008-11-05
Last Modified: 2013-11-10
I have a few simple requirements that I know can be accomplished using either VB or WSH.
I need a script to run from each workstation and perform the following:

1. Create a new folder on the server share \\student-srv1\LabBackup\<MachineName>
2. Copy of the "C:\Documents and Settings" folder and deposit this into the folder \\student-srv1\LabBackup\<MachineName>

So for example if the script were run and completed on machine named "LabPC-213":

-A folder called  "LabPC-213" would be created with the path \\student-srv1\LabBackup\LabPC-213
-The folder "Documents and Settings" from LabPC-213 would be copied into the folder LabPC-213 on \\student-srv1\LabBackup\ leaving \\student-srv1\LabBackup\LabPC-213\Documents and Settings
Question by:every1isevil2
    LVL 5

    Accepted Solution

    I would use a batch script for this:

    set dest=\\student-srv1\LabBackup\
    mkdir %dest%%computername%
    xcopy /E /C /Q /Y /Z /H /R "C:\Documents and Settings" %dest%

    Open in new window

    LVL 4

    Author Comment

    Great! I had to modify it just a bit.

     set dest=\\student-srv1\LabBackup\
    mkdir %dest%%computername%
    xcopy /E /C /Q /Y /Z /H /R "C:\Documents and Settings" %dest%%computername%

    Open in new window

    LVL 5

    Expert Comment

    If that script worked for you why are you closing the question without awarding points? I didn't see anything in your modifications that would make any difference in how the script runs.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    The viewer will learn how to download, install and use CrashPlan from on Windows 7. Open your browser and go to Click get started, it’s free then Click the Download CrashPlan button: Click save in Internet Explorer, the…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now