PDA

Click to See Complete Forum and Search --> : copying a file to a directory


Insane Killa
Dec 9th, 1999, 01:44 PM
the autostart code wouldn't work for me but thanx anyway aaron.

so i was wondering does anyone have a code that will copy the a program thats in the same folder as the program the user is using.

for example they are running a program called project1

and i want the program to then copy the file project2 into the directory: C:\WINDOWS\Start Menu\Programs\StartUp

also i don't want a code that has the directory of the current folder i only want it to search and copy the file from the file its currently in. so no c:\programfiles\project2.exe
just project2.exe.

thanx

SteveS
Dec 9th, 1999, 02:02 PM
A project defaults to the current directory it was started in unless you create a shortcut to the program and specify a startup directory.

Therefore somthing like

FileCopy "MyFile.Txt", "C:\Program Files\MyFile.Txt"

Should just work

If you're having problems with the initial directory being different then add the following line to the Form_Load Sub

ChDir App.Path

This sets the current path to the application location.

Hope this helps,

Steve.