Visual basic code to replace a batch

Posted on 2007-10-04
Last Modified: 2013-11-27
I need an .exe application who do the following things for me.

I'm doing those things using a batch file, but I need an exe to do this:

xcopy 1 c:\ /E
xcopy 2 c:\ /E

Please if you can help me to do this in visual basic.

Question by:angel12345
    LVL 25

    Accepted Solution

    to copy the directories, in 2005, do something like this:


    obviously replace <sourcedir> and <destdir> with valid directory paths (don't use the < and >)

    as for regedit you could use a process to do this:
            Dim p As New System.Diagnostics.Process()
            p.Start("c:\windows\system32\regedit.exe", "x.reg")

            this assumes that x.reg is in the same subdirectory as this executable, otherwise you'd need to provide a path If you just want to change registry keys, you might want to use


    'online help can tell you the args to pass to this.

    I'm not sure why this would be better than a batch file.


    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
    If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    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

    14 Experts available now in Live!

    Get 1:1 Help Now