Copy file from and to from VISTA give problem
-
hi all, i am simply copy a file from one computer to other.i use following command
File.Copy(BakFileName, "\\" & mdChecking.PublicServerName & "\" & shellCommand.Trim.Replace(":", ""), True) 'mdChecking.PublicServerName is computer name.
above code works well when i copy file from XP to XP, VISTA to XP but fail when i copy from XP to VISTA and give error "Login Failure:unknown user name or bad password" Please suggest how can i resolve this error? -
hi all, i am simply copy a file from one computer to other.i use following command
File.Copy(BakFileName, "\\" & mdChecking.PublicServerName & "\" & shellCommand.Trim.Replace(":", ""), True) 'mdChecking.PublicServerName is computer name.
above code works well when i copy file from XP to XP, VISTA to XP but fail when i copy from XP to VISTA and give error "Login Failure:unknown user name or bad password" Please suggest how can i resolve this error?And can you copy files using Explorer or other file manager software?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
hi all, i am simply copy a file from one computer to other.i use following command
File.Copy(BakFileName, "\\" & mdChecking.PublicServerName & "\" & shellCommand.Trim.Replace(":", ""), True) 'mdChecking.PublicServerName is computer name.
above code works well when i copy file from XP to XP, VISTA to XP but fail when i copy from XP to VISTA and give error "Login Failure:unknown user name or bad password" Please suggest how can i resolve this error?It would appear that your code is building an invalid UNC path, or a path that doesn't exist. Move the code that builds the path to its own variable so you can see what it's building, then you can troubleshoot it better.
Dim destinationPath As String = String.Format("\\{0}\{1}", mdChecking.PublicServerName, shellCommand.Trim.Replace(":", ""))
File.Copy(BakFileName, destinationPath, True)Now, the other part of the problem is are these two machines working in a Workgroup in an Active Directory?? If Workgroup, you've got problems. Each machine matintains its own list of user accounts and does NOT trust the accounts of another machine. If in Active Directory, then is each machine in the same Domain?? Each machine in the domain will use and trust a central list of user accounts.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008