Just a quick look... In your destination you do not have a fully qualified path. That is probably the problem. Did you look up the FileCopy Command?
http://www.autoitscript.com/autoit3/...s/FileCopy.htm
Printable View
Just a quick look... In your destination you do not have a fully qualified path. That is probably the problem. Did you look up the FileCopy Command?
http://www.autoitscript.com/autoit3/...s/FileCopy.htm
I'm sorry.
I get this error
Run-time error '75':
Path/File access error
And then it highlights line 48.
Even when i put
vb Code:
Public Sub BackupMembersFile() Dim Source As String Dim Destination As String Source = App.Path & "\Members.dat" Destination = "C:\Members.dat" FileCopy Source, Destination End Sub
Still get same error?
Does the file already exist? You will need to delete it first.
BTW: Which is line 48....
Line 6
The file Exists in my folder but im trying to get it to copy over on to the c drive.
The question was does the file exist where you are attempting to copy the file?
Do you have write access rights to the root of the drive?
Why would you want to copy to the root of the drive anyway?
The file dosent exist where im trying to copy it to.
Im root administrator so i think so
just using it as an example at the moment will change in the future tho.
The do a Debug.Print on the Source to see what it contains.
Sorry wrong
I made a folder called BackUps in the same folder as the program how do i get it to save it in there.
I used and it worked
vb Code:
Public Sub BackupMembersFile() Dim Source As String Dim Destination As String Source = App.Path & "\Members.dat" Destination = "D:\Members.dat" FileCopy Source, Destination End Sub
Now i tryed the bellow code and wont work?
vb Code:
Public Sub BackupMembersFile() Dim Source As String Dim Destination As String Source = App.Path & "\Members.dat" Destination = "BackUps\Members.dat" FileCopy Source, Destination End Sub
Sorry wrong
I made a folder called BackUps in the same folder as the program how do i get it to save it in there.
I used and it worked
vb Code:
Public Sub BackupMembersFile() Dim Source As String Dim Destination As String Source = App.Path & "\Members.dat" Destination = "D:\Members.dat" FileCopy Source, Destination End Sub
Now i tryed the bellow code and wont work?
vb Code:
Public Sub BackupMembersFile() Dim Source As String Dim Destination As String Source = App.Path & "\Members.dat" Destination = "BackUps\Members.dat" FileCopy Source, Destination End Sub
In the IDE you set a breakpoint in your code and start the program. It will stop at the breakpoint then you can step thru the code with f8.
Perhaps this will help http://www.engineering.usu.edu/cee/f...BDebugging.htm
Of course it doesn't work... You are back to the same thing as before, a non fully qualified destination.
So how would that work?
That works fine.
But how will it work on other comps now?
How do i get it to copy to desktop?
vb Code:
Public Sub BackupMembersFile() Dim Source As String Dim Destination As String Source = App.Path & "\Members.dat" Destination = "C:\Users\Mark\Documents\Marks Source Codes\Smiley's Snooker\BackUps\Members.dat" FileCopy Source, Destination End Sub
That is why you do not use hard code paths. You need to use relative paths unless you know exactly where you will be placing the files.
Why not just make create the backup folder in the App.Path and reference it there?
I used this code on post 54 and it works fine how do i get it just to save on desktop. So it works for everyone.
I just explained that...
I dont know how to change it?
Destination = App.Path "\BackUps\Members.dat"