Solved

xcopy vbs with drive selecting

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now