lgodfrey Posted June 26, 2004 Share Posted June 26, 2004 I've run into a problem accessing exe compiled script relatied to long pathname.... I am running script exe files from Excel VBA using Shell. If I put the exe in my document files, such as: "C:\Documents and Settings\Lawrence Godfrey\My Docuements\1-TESTing\TRY_ONLY.exe" I get an invalid path error. If I move it to the root directory, it runs. "C:\TRY_ONLY.exe" If I start replacing the path with 8.3 format, it works until I try putting the exe in "My Documents" Directory. It probably has to do with the fact that there is a space in the first six character. GetShortPathName in KERNEL32 returns a null for the full path name, so it can't handle this long path either. I could not find any WWW links to something that talks about VBA Shell pathname limitations. Any one know where I can find this info???????? Obviously I would like to get a work around to allow me to keep the AutoIT.exe files in My Documents sub-directory. Best Regards Larry I'm, Lovin' IT, X Link to comment Share on other sites More sharing options...
CyberSlug Posted June 26, 2004 Share Posted June 26, 2004 (edited) Here are three wokarounds, starting with the "best":1) Use the program VSubst which lets you assign a virtual drive letter to that long path. For example, "C:\Documents and Settings\Lawrence Godfrey\My Docuements\1-TESTing\TRY_ONLY.exe" could become "Z:\TRY_ONLY.exe"2) Partition your hard drive and make "My Documents" be that new partition 3) Or--assuming Windows NT/200/XP with an NTFS-formatted drive--you could create a hard link to that file. For problems not strictly regarding AutoIt, you can use the chat forum. Edited June 26, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
lgodfrey Posted June 26, 2004 Author Share Posted June 26, 2004 I'm impressed with this forum, too, besides AutoIT. Two postings today from me, good reponses for both. THanks, CyberSlug for the detailed workarounds, much appreciated. And thanks for the "hint" about where to post the last question, I'll figure it out eventually :iamstupid: Regards Larry I'm, Lovin' IT, X Link to comment Share on other sites More sharing options...
tutor2000 Posted June 26, 2004 Share Posted June 26, 2004 You may need to INCLUDE the quotes...Run('"C:\Documents and Settings\Lawrence Godfrey\My Docuements\1-TESTing\TRY_ONLY.exe"')orRun("""C:\Documents and Settings\Lawrence Godfrey\My Docuements\1-TESTing\TRY_ONLY.exe""")because of the space in the pathLar.I seem to recall a dos command to subst a drive letter for a pathRick Link to comment Share on other sites More sharing options...
lgodfrey Posted June 26, 2004 Author Share Posted June 26, 2004 Thanks, all you members. Got it to work with the dirctory mapping/Vsubt in about 10 minutes, so I've stopped pulling my hair out trying to find a fix in VBA. I had tried """ and "' quote marks B4 posting for help, but they didn't seem to work with my quick tests. I am happy as a clam right now (new smilie needed??? ) Thanks for the help. I'm, Lovin' IT, X Link to comment Share on other sites More sharing options...
therks Posted June 28, 2004 Share Posted June 28, 2004 I seem to recall a dos command to subst a drive letter for a path RickI know it's been solved already, but... C:\WINDOWS>subst /? Associates a path with a drive letter. SUBST [drive1: [drive2:]path] SUBST drive1: /D drive1: Specifies a virtual drive to which you want to assign a path. [drive2:]path Specifies a physical drive and path you want to assign to a virtual drive. /D Deletes a substituted (virtual) drive. Type SUBST with no parameters to display a list of current virtual drives. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now