Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

xcopy vbs with drive selecting

Posted on 2009-04-07
5
Medium Priority
?
411 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
  • 2
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
t0t0 earned 1000 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 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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 …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

971 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