|
-
Jun 25th, 2004, 09:42 AM
#1
Thread Starter
Lively Member
How to copy file in Windows\system folder?
Hiii,
I need to copy few .dll and .ocx file to C:\Windows\System folder before my application loads.
Wheni tired it gives me error
"Permission denied".
What could be problem? And how could you remove above problem or copy files?
Everythin is welcome.
Thanks in advance.
HDave
~~~......Hope never dies. one has to work for it to make it reality.......~~~
-
Jun 26th, 2004, 11:31 AM
#2
Whats your code?
Permission denied usually means the file is in use.
-
Jun 27th, 2004, 11:42 AM
#3
Member
or the user doesn't have privleges/permissions
-
Jun 28th, 2004, 09:15 AM
#4
Thread Starter
Lively Member
Hii,
I checked file is not in use. And I caneasily copy/pes/delete files from Windows/system folder in windows explorer. But whe i tried to do it through code, it generates error:
Run time error"70":
Permission denied.
My code is,
retval = Trim(GetWindowsDirectory(buffer, 255))
dest = buffer & "\System"
comdatafile = App.Path & "\" & "Components.data" 'Data file contains name of the files to be copied.
Set tx = fsy.OpenTextFile(comdatafile, ForReading, False)
Files = tx.ReadLine()
While (Files <> "")
srce = App.Path & "\" & Files
Set file1 = fsy.GetFile(srce)
If fsy.FileExists(srce) Then
fsy.CopyFile srce, dest
Else
MsgBox "File:" & Files & "not found. Application configuration failed.", vbApplicationModal + vbExclamation + vbOKOnly, "Application Error...."
fsy.DeleteFile (comloadfile)
Exit Sub
End If
Files = tx.ReadLine()
Wend
tx.Close
I do not see any problem. If anyone can tell me what is wrong?
Thanks in advance.
HDave
~~~......Hope never dies. one has to work for it to make it reality.......~~~
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
|