|
-
Aug 25th, 2004, 10:50 PM
#1
Thread Starter
Lively Member
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
-
Aug 25th, 2004, 11:01 PM
#2
MsgBox Replace(LCase(App.Path), "program", "stage_in")
-
Aug 25th, 2004, 11:13 PM
#3
Thread Starter
Lively Member
Thanks, Deepak Sakpal.
BTW, is file path case sensitive?
ie., "c:\np303\Program" vs "C:\NP303\proGram?"?
-
Aug 25th, 2004, 11:14 PM
#4
filepath is not case sensitive but the Replace function is case sensitive.
-
Aug 25th, 2004, 11:53 PM
#5
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"
-
Aug 26th, 2004, 12:01 AM
#6
Thread Starter
Lively Member
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
-
Aug 26th, 2004, 12:14 AM
#7
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.
-
Aug 26th, 2004, 12:20 AM
#8
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.
-
Aug 26th, 2004, 01:26 AM
#9
Thread Starter
Lively Member
how to change file path? [RESOLVE]
-
Aug 26th, 2004, 01:56 AM
#10
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
-
Aug 26th, 2004, 02:03 AM
#11
thanks for updating me
-
Aug 26th, 2004, 02:05 AM
#12
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|