Hello everybody , When I write VB6 program , I need to copy files to C:\Windows. But always fail as I don't have Administrator's Right. I found a program on web but also fail : Option Explicit Private Sub Command1_Click() Const ssfDESKTOP = 0 Const ssfWINDOWS = 36 Dim OriginalFile As String Dim CopiedFile As String Dim F As Integer With CreateObject("Shell.Application") With .NameSpace(ssfDESKTOP).Self OriginalFile = .Path & "\test-orig.txt" End With With .NameSpace(ssfWINDOWS).Self CopiedFile = .Path & "\test-copy.txt" End With End With F = FreeFile(0) Open OriginalFile For Output As #F Print #F, "Testing!" Close #F DoEvents FileCopy OriginalFile, CopiedFile Kill OriginalFile MsgBox FileLen(CopiedFile) End Sub Please help me. Thanks a lot
|