473,566 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copying a whole thumb drive in VB

2 New Member
I am trying to write a simple VB app to copy all directories and files off a thumb drive to a directory on a pc. I have a couple things I am trying to automate.

Final Build will:
- Have multiple USB connections for multiple drives to copy from at the same time
- Have seperate directories for each individual who will copy to the pc
- Have a list box where I would like to choose which directory (Individual) to copy files to, and a seperate list box to choose which thumb drive to copy from
- Auto name each directory with a prefix and current time


Below is what I've been playing with.
- I can select an individual from my list box
- I Can copy a directory and subs over to D:\Video
- Decide what to call it with the current time.

BUT I cannot copy over a whole drive. for example - if H is my thumb drive please see below.

Works:
- this will create a folder under D:\video
- name that folder by whatever is selected in the list box, and the current time
- Then copy over everything from H:\pix to D:\Video\<new folder>

My.Computer.Fil eSystem.CreateD irectory("D:\Vi deo\" & lstvidguy.Selec tedItem & time)
My.Computer.Fil eSystem.CopyDir ectory("H:\pix" , "D:\Video\" & lstvidguy.Selec tedItem & time, True)


Not work - BUT what I need:
- this will create a folder under D:\video
- name that folder by whatever is selected in the list box, and the current time
- Then copy over everything from H:\ to D:\Video\<new folder>

My.Computer.Fil eSystem.CreateD irectory("D:\Vi deo\" & lstvidguy.Selec tedItem & time)
My.Computer.Fil eSystem.CopyDir ectory("H:\", "D:\Video\" & lstvidguy.Selec tedItem & time, True)

What I need help with is:
1) What little code am I missing to copy over the whole drive?

Please keep in mind I have 1 semester of beginning VB under my belt..:)
Jul 27 '08 #1
1 2252
Curtis Rutland
3,256 Recognized Expert Specialist
I always use FileInfo and DirectoryInfo objects for file transfers. You should check them out.
Jul 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3625
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore my settings if my profile became tampered with or corrupt. Is there any sample code available out there? -Robert
2
2663
by: .Net Believer | last post by:
I using the routine below to copy file to a network drive for a regular backup process. Before calling this routine I using another function to check the presence of the LAN connection and the server where the network drive exists. Although of this check I am sometimes getting an exception (in 5% of times)saying "Could not find the...
3
1342
by: Jeries Shahin | last post by:
Hi I am trying to copy files from a folder on a Novel machine, the folder is in the UMC format (i cannot map a network drive for some business reasons). Upon copying, it fires an IOException saying that the file does not exist. Any idea how can I do it? (the user copying is the Novel Administrator)
2
7985
by: Jerad Rose | last post by:
I have a fairly simple C# console app which copies files from a network folder to a local folder. When the app resides on my local C: drive, it runs just fine. However, when the app resides on a network drive, copying the same files from the same source drive and to the same destination drive, it gives me the following exception: ...
3
3300
by: ryancol | last post by:
I have a couple usb 2.0 flash drives. I use them on either windows 2000 or windows XP. When I copy (drag and drop) a file folder to them such as a file folder with like 10 or 20 pictures in it the file folder will show that it made it to the flash drive. I can open it on the flash drive and the pics are in there. BUT if I properly eject the drive...
2
3738
by: kilik3000 | last post by:
Is there a way to catch an event/trigger that *might* be fired when a usb thumb drive is inserted into a Vista PC? The reason I ask is that I'd like to catch that event and back up the content of the thumb drive to the local machine with a custom process. I realize there might be some security issues with this...but it would sure be...
2
77943
by: Water Man | last post by:
Hello, All Lask week my hard drive (partition C: and D:) and removeable disk(thumb drive) cannot open by double click, but its open by right click . So I want to open by double click. Please help
3
2851
by: PW | last post by:
Hi, I just bought a SanDisk Cruzer 4GB "U3" thumb drive. Is it possible to run an Access 2003 MDE off of one, complete with data? If so, what would I have to do to get it to work? Just curious. No Biggie! I thought I'd take a break from writing code and try something different. I guess I could go fishing :-) -paulw
0
1126
by: tootypegs | last post by:
hi, i've looked everywhere for some information on this topic and i just can't find anything. Basically i created a program to create an image of a thumb drive. I now want to be able to parse this image so i can show the directory structure and all of the files. Can anyone point me in the direction of resources so i can try and learn more about...
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.