Results 1 to 2 of 2

Thread: copying a file to a directory

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    65

    Post

    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


  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Ireland
    Posts
    96

    Post

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width