|
-
Aug 13th, 2001, 04:18 PM
#1
Thread Starter
Lively Member
Simple question
Could you please tell me how to do the following:
Copy and Execute a program from vb code? for example:
I want user to click test.exe, then i want test.exe to make a copy of itself and put it in c:\program files\testfolder. Thanks.
Also, how do you move, copy, paste and delete files? Not just exes, i mean jpg, txt whatever. Thanks
-
Aug 13th, 2001, 04:41 PM
#2
Frenzied Member
You can make a refrence to the microsoft runtime library and then do the following
It's a little messy.
VB Code:
Dim objFSO As New FileSystemObject
Dim objFolder As Folder
Dim sDestination As String
Dim sSource As String
sDestination = "C:\program Files\testfolder\"
sSource = App.Path
Set objFSO = New FileSystemObject
If Not objFSO.FolderExists(sDestination) Then
objFSO.CreateFolder (sDestination)
End If
objFSO.CopyFolder sSource, sDestination, True
-
Aug 13th, 2001, 06:40 PM
#3
PowerPoster
Again, jjortiz, there's an easier way. (remembers last time...) 
VB Code:
FileCopy [i][Source][/i], [i][Destination][/i]
-
Aug 14th, 2001, 06:28 PM
#4
Frenzied Member
I know. Bad habits die hard. What can i say. Now remind me, but does Filecopy support UNC paths?
-
Aug 15th, 2001, 07:09 PM
#5
PowerPoster
Never tried.
Maybe you can test it out.
-
Aug 15th, 2001, 07:16 PM
#6
Fanatic Member
Originally posted by jjortiz
Now remind me, but does Filecopy support UNC paths?
Yes!
Mindcrime : )
ICQ 24003332
VB 5.0, VB 6.0 SP5, COM, DCOM, VB.NET Beta 2, Oracle 8
-
Aug 15th, 2001, 08:06 PM
#7
Frenzied Member
Originally posted by jjortiz
I know. Bad habits die hard. What can i say. Now remind me, but does Filecopy support UNC paths?
I know im dumb, but whats a UNC path? A path with wildcards?
You just proved that sig advertisements work.
-
Aug 15th, 2001, 08:14 PM
#8
Member
A network path, like
\\yourcomputer\yourshare\subdirectory\file.doc
-
Aug 15th, 2001, 08:26 PM
#9
Frenzied Member
You just proved that sig advertisements work.
-
Aug 16th, 2001, 08:44 PM
#10
Frenzied Member
It's a network path uniform network something i assume. I forgot what resolves the addresses on an NT network. I think its wins if i am not wrong.
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
|