|
-
Jan 5th, 2000, 01:53 AM
#1
Thread Starter
New Member
im a newbie, so bear with me. could you show me how to make an exe that copies another exe to a specified directory, then run that exe
thanks
-
Jan 5th, 2000, 01:59 AM
#2
Put this in a Module, (Remove any Forms from the Project)..
Code:
Sub Main()
FileCopy "C:\Files\MyFile.exe", "C:\NewDir\MyFile.exe"
Shell "C:\NewDir\MyFile.exe", vbNormalFocus
End Sub
This copies the File: MyFile.exe from C:\Files to C:\NewDir Then Launches MyFile.exe before closing.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 5th, 2000, 03:20 AM
#3
i may be wrong, but couldnt you use a DOS batch file for this task??
-
Jan 5th, 2000, 03:23 AM
#4
Guru
Then you would have to worry about the distribution and proper placement of the batch file. Why not use 2 lines of code instead? What if he needed to dynamically create a new directory or pass parameters? Batch files are not that flexible....
-
Jan 5th, 2000, 03:47 AM
#5
Thread Starter
New Member
well what im trying to do is put the files i want copied, onto a CD, so i can put in a system, and load up some programs when i click a button in a little menu. how can i tell it to copy the file, if its in the same directory as the exe. (since its would be on a cd-rom, the address wouldn't always be the same)
Thanks
-
Jan 5th, 2000, 04:42 AM
#6
The App.Path Property returns the Directory Path from Which your Application was Launched, you can use this, ie.
FileCopy App.Path & "\Files\MyFile.exe", "C:\NewDir\MyFile.exe"
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
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
|