0

Bute there's an error...
Error: The given path's is not supported

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Try

        Dim FileToCopy As String
        Dim NewCopy As String
        Dim password As String = "Cyndy"
        Dim username As String = "Abbang"
        'NewCopy = "192.168.xx.xx\c$\HS.exe" & username & ":'" & password
        'FileToCopy = "c:\HS.exe"
        FileToCopy = "\\192.168.xx.xx\C$\BACKUP\HRIS.exe"
        NewCopy = "C:\HRIS.exe" & username & ":'" & password

        If System.IO.File.Exists(FileToCopy) = False Then

            System.IO.File.Copy(FileToCopy, NewCopy, False)

            MsgBox("File Uploaded Successfully")

            MsgBox("File Copied")
        Else
            MsgBox("cannot copy")
        End If

    Catch ex As Exception
        MessageBox.Show(ex.Message)
    End Try

End Sub

2
Contributors
3
Replies
41
Views
3 Years
Discussion Span
Last Post by oussama_1
0

Still now working..

FileToCopy = "\\PROD-PC\C$\BACKUP\HRIS.exe"

Edited by Reverend Jim: fixed formatting

0

make sure that this path exist:
start >> Run >> \PROD-PC\C$\BACKUP\
if it doesn't exist then you are goin to need to share your hard drive "C" then it'll appear in that directory "\PROD-PC".

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.