Solved

xcopy vbs with drive selecting

Posted on 2009-04-07
5
401 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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