Solved

xcopy vbs with drive selecting

Posted on 2009-04-07
5
404 Views
Last Modified: 2012-05-06
Hello all

i am currently using xcopy to update my usb stick with for winpe, i am trying to get a vbs which would do the following popup window asking which drive letter to select-copy files to letter selected, any ideas?
0
Comment
Question by:EfrenM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
t0t0 earned 250 total points
ID: 24086693
Why not use plain old DOS batch files? Something along these lines:


@echo off
set /p drive=Please select drive letter to copy files to:

if not exist %drive%\ (
   echo Drive %drive% does not exist
   exit /b 1
)

xcopy %source%\*.* %drive%\
exit /b 0

0
 
LVL 14

Assisted Solution

by:yehudaha
yehudaha earned 250 total points
ID: 24086961
try this
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
strSource = InputBox("enter drive letter or path to copy from. e.g: c:\")
strTarget = InputBox("enter Path To Copy To. e.g: d:\temp")
objFSO.CopyFile strSource & "\*.*" , strTarget , OverwriteExisting
MsgBox "Done"

Open in new window

0
 
LVL 2

Author Closing Comment

by:EfrenM
ID: 31567471
both worked perfectly. thank you
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24096594
Wow!! Thank you. I weren't expecting that at all!!
0
 
LVL 14

Expert Comment

by:yehudaha
ID: 24097126
thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 5 hours left to enroll

617 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