|
-
Jun 1st, 2007, 10:57 PM
#1
Thread Starter
New Member
VB: Copy file(s) between PC on the same domain
Hello, I'm so frustrated looking for answer on this. It sounds very easy and yet very hard to look for solution.
I need a simple code to allow me to transfer file(s) from computer1 to computer2 which are connected on the same domain. I'm not talking about FTP.
It's kind of like copy \\computernameA\c$\folderA\file*.xls to \\computernameB\d$\folderB\file*.xls
Please note that everytime I connect to any computer, it prompts me for username, password, and domain name.
How is this doable in VB6? If I'm copying a large chunk of file, would it be a problem? Also, is there a way of having a progress bar while it's copying the file(s)?
Thank you very much.
-
Jun 2nd, 2007, 12:14 PM
#2
Thread Starter
New Member
-
Jun 4th, 2007, 12:04 PM
#3
Thread Starter
New Member
Re: VB: Copy file(s) between PC on the same domain
Since the weekend is done, I'm guessing all the gurus are back
Please help!
Thank you very much.
-
Jun 4th, 2007, 04:15 PM
#4
Re: VB: Copy file(s) between PC on the same domain
If the PC is secured (which it sounds like),you can't do what you want. If you share the drive on the computers you want to access (share the root directory if you want access to the entire drive), you can either address them as \\server\sharename\subdirectory, or you can map them and address them as mappeddriveletter:\subdirectory
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jun 4th, 2007, 06:10 PM
#5
Thread Starter
New Member
Re: VB: Copy file(s) between PC on the same domain
What do you mean by secured? I've got access to it with my username and password. I could transfer files back and forth using the convention of \\servername\drive\folder\subfolder using normal window. All I need is to do this functionality using VB.
-
Jun 6th, 2007, 02:33 PM
#6
Re: VB: Copy file(s) between PC on the same domain
You'll have to map the remote drives and copy the files between drive letters.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jun 14th, 2007, 10:10 PM
#7
Addicted Member
Re: VB: Copy file(s) between PC on the same domain
System.IO.File.Copy accepts UNC paths.
Example:
Code:
System.IO.File.Copy("\\" + server1 + "\" + share1 + "\readme.txt", "\\" + server2 + "\" + share2 + "\readme.txt")
If its prompting you for a username and password, maybe start your application by right clicking on it and choosing "Run-As" and typing your username and password since its obviously not inheriting your security rights.
- Joe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|