Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Copy file from and to from VISTA give problem

Copy file from and to from VISTA give problem

Scheduled Pinned Locked Moved Visual Basic
helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sunil goyalG
    wrote on last edited by
    #1

    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?

    H D 2 Replies Last reply
    0
    • S sunil goyalG

      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?

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      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.”

      1 Reply Last reply
      0
      • S sunil goyalG

        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?

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups