D djlysuc Registered User. Local time Today, 16:46 Joined May 22, 2006 Messages 11 Jul 3, 2006 #1 Hi, Im looking for a way to remove the file name from a string to use the ChDir statement in vb?? convert: C:\dir1\dir2\myfile.exe to: C:\dir1\dir2 Any help will be appreciated. Thanks. Last edited: Jul 3, 2006
Hi, Im looking for a way to remove the file name from a string to use the ChDir statement in vb?? convert: C:\dir1\dir2\myfile.exe to: C:\dir1\dir2 Any help will be appreciated. Thanks.
mhartman Dr. Data Local time Today, 08:46 Joined Jun 5, 2006 Messages 441 Jul 3, 2006 #2 Hello: Use the following statement: y = Left$(Text0, InStrRev(Text0, "\") - 1) ' If you had a text box named Text0 on your form with your "C:\dir1\dir2\myfile.exe" string in it, the above would extract "C:\dir1\dir2" ' Regards Mark
Hello: Use the following statement: y = Left$(Text0, InStrRev(Text0, "\") - 1) ' If you had a text box named Text0 on your form with your "C:\dir1\dir2\myfile.exe" string in it, the above would extract "C:\dir1\dir2" ' Regards Mark
D djlysuc Registered User. Local time Today, 16:46 Joined May 22, 2006 Messages 11 Jul 3, 2006 #3 Thanks Mark. It must be Monday, I didn't think of doing it that way.