|
-
Feb 9th, 2006, 07:30 AM
#1
Thread Starter
Junior Member
Copy and paste program
How can i make a copy of my program and paste it in another location??
-
Feb 9th, 2006, 07:55 AM
#2
Re: Copy and paste program
If you are talking about a physical disk file, then don't bother with copy 'n paste, just make a copy of it using VB's FileCopy
VB Code:
FileCopy "c:\fido_glc.exe, "c:\backup\fido_glc.exe"
-
Feb 9th, 2006, 08:08 AM
#3
Thread Starter
Junior Member
Re: Copy and paste program
But i don`t know the location of the original prog.
I think there is a code that gets the original location but don`t know it.
-
Feb 9th, 2006, 08:10 AM
#4
Hyperactive Member
Re: Copy and paste program
App.Path specifies the path of the project .VBP file when running the application from the development environment or the path of the executable file when running the application as an executable file.
To deny our own impulses is to deny the very thing that makes us human
-
Feb 9th, 2006, 08:12 AM
#5
Re: Copy and paste program
 Originally Posted by fido_glc
But i don`t know the location of the original prog.
I think there is a code that gets the original location but don`t know it. 
Ok. I'm guessing this means that your users could install it anywhere they want to and you have no way of knowing where, right?
And you need to find out where it is so you can make a backup of it?
Once, you have the location (and I can show you how to do that providing I'm right about what is going on) do you want to make a special backup folder? Once you know where it is, where do you want to copy it to?
-
Feb 9th, 2006, 08:23 AM
#6
Hyperactive Member
Re: Copy and paste program
Here is some example code to get the path, create a backup folder and copy the exe file (also works if user renames file)
VB Code:
'Get the app path
Dim strPath As String
strPath = App.Path
If Right(strPath, 1) <> "\" Then
strPath = strPath & "\"
End If
'Make backup folder
MkDir "c:\Backup\"
'Copy the app exe file
FileCopy strPath & App.EXEName & ".exe", "c:\Backup\" & App.EXEName & ".exe"
To deny our own impulses is to deny the very thing that makes us human
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
|