Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8241513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:51:28+00:00 2026-06-07T20:51:28+00:00

Okay, so here’s the deal: I’m trying to put together a script that will

  • 0

Okay, so here’s the deal: I’m trying to put together a script that will perform a simple xcopy. The problem is I want the users to be able to browse for the source and destination folders. I’ve got a couple simple parts, but I’ve been unable to piece them together, especially trying to differentiate the source from destination, and trying to get the output from the browse function…

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Example", 1, "c:\Programs")

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Example", 1, "c:\Programs")

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "Xcopy ""objShell"" ""objShell"" /C /D /E /H /I /K /R /S /Y"

Any help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:51:31+00:00Added an answer on June 7, 2026 at 8:51 pm

    Like this it will work, tested on Windows 7

    Set objShell = CreateObject("Shell.Application")
    Set oFso = CreateObject("Scripting.FileSystemObject")
    root = "c:\"
    Set source = get_path(objShell.BrowseForFolder(0, "Source folder", 1, root))
    Set target = get_path(objShell.BrowseForFolder(0, "Target folder", 1, root))
    Set objShell = WScript.CreateObject("WScript.Shell")
    command = "Xcopy """&source&""" """&target&""" /C /D /E /H /I /K /R /S /Y"
    'wscript.echo command
    objShell.Run command
    
    function get_path(foldername)
      Set oFolderItem = foldername.Items.Item
      Set selected = oFso.GetFolder(oFolderItem.Path)
      If selected.IsRootFolder Then
        Set get_path = oFso.GetDrive(selected.Drive)
      Else
        Set get_path = oFso.GetFolder(oFolderItem.Path)
      End If
    end function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay here is what I'm trying to do: I have a model object that
Okay so here is the deal. As the question states, I'm trying to POST
Okay here is what I'm, trying to do I want to escape the period
okay so here is my problem in my main project I'm trying to fire
Okay so here's, the scenario I have a thumbnail that contains an artists profile
Okay so here is what I want to do. I want to add a
Okay so here is the code that I am using function AddProducts($aTitle, $aDescription, $aPrice,
Okay, here is the deal: User's can buy 'gold' inside of the app with
Okay, here is my problem: Im implementing an algorithm in Java and part of
Okay so here is the problem I am having. I have several unit tests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.