Results 1 to 12 of 12

Thread: how to change file path?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    69

    Red face how to change file path?

    I have vb run on this folder, c:\np303\program, and with 4 subfolders, "archive", "stage_in", and logs.

    like this:

    c:\np303\program
    c:\np303\stage_in
    c:\np303\archive
    c:\np303\log

    strSource = app.path
    msgbox strSource => c:\np303\program

    How to change the path to c:\np303\stage_in without using "chdir"?

    Thanks
    vb999

  2. #2
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424
    MsgBox Replace(LCase(App.Path), "program", "stage_in")

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    69
    Thanks, Deepak Sakpal.

    BTW, is file path case sensitive?

    ie., "c:\np303\Program" vs "C:\NP303\proGram?"?

  4. #4
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424
    filepath is not case sensitive but the Replace function is case sensitive.

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    I know that folders ARE case sensative. I found out when unzipping. things were extracted to a NEW folder when I used lower case only. using XP Home.



    Path = "place new path statement here"

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    69
    Thanks for the clarification.

    Suppose, someone goes to directory and change path name, ie change c:\np303\stage_in to c:\np303_stagein, then program will bound out. How to prevent the directory to be changed by someone?

    Noted: the program will read the files from stage_in folder

    vb999

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    refering to PATH, not folder

    you would have to save it, change it, and then change it back when you are done.
    Last edited by dglienna; Aug 26th, 2004 at 12:23 AM.

  8. #8
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424
    its users responsibility is not to change the folder's path. If he changes anyways then ur application may have errors means user may face problems running ur application. So, he will not take that risk to change folder's path.

    We all use windows. What if we renamed WINDOWS folder or PROGRAM FILES folder ? Its our responsibility.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    69

    how to change file path? [RESOLVE]

    Thanks, Deepak Sakpal.

  10. #10
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Originally posted by Deepak Sakpal
    filepath is not case sensitive but the Replace function is case sensitive.
    Just for others:

    The Replace function doesn't have to be case sensitive. The 6th argument of the Replace function asks for a comparison method of the text.

    vbBinaryCompare - VISUAL BASIC != visual basic
    vbTextCompare - VISUAL BASIC == visual basic

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  11. #11
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424
    thanks for updating me

  12. #12
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424
    Sometimes we know the things that are really hard but sometimes we do minor mistakes like i did.

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