Solved

xcopy vbs with drive selecting

Posted on 2009-04-07
5
402 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

738 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