Problems with long paths

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
pasdad1
Junior Coder
Posts: 21
Joined: Wed Nov 17, 2004 1:09 am

Problems with long paths

Post by pasdad1 » Wed Jun 24, 2009 6:56 pm

I am having problems with IfFileExists and ReadIniFile when the file paths are long and contain spaces. I'm running version 10.1.21 Pro

I have code similar to this:

Code: Select all

IfFileExists>"%RPath%\bin\ppHTTPLookup.ini"
  stuff goes here
Else
   MessageModal>"%RPath%\bin\ppHTTPLookup.ini" NOT FOUND
Endif
And at runtime the value of RPath=
"C:\PROGRAM FILES\ADC LEGAL SYSTEMS INC\PERFECT PRACTICE INSTALL 02-06-08\APPS\ADCPP2\PERFPRAC"

The Else always executes, and here is what MessageModal shows me:

Code: Select all

"C:\PROGRAM  FILES\ADC  LEGAL  SYSTEMS  INC\PERFECT  PRACTICE  INSTALL  02-06-08\APPS\ADCPP2\PERFPRAC\bin\ppHTTPLookup.ini"  NOT  FOUND!
Any thoughts on why this doesn't work?

Thanks.

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jun 24, 2009 7:03 pm

Remove ALL the quotes and let us know if that helped.

pasdad1
Junior Coder
Posts: 21
Joined: Wed Nov 17, 2004 1:09 am

PROBLEMS WITH LONG PATHS

Post by pasdad1 » Wed Jun 24, 2009 7:24 pm

Removing the quotes still makes it operate the same. **BROKEN**

One extra tidbit..... I am compiling this to an EXE. Don't know yet if that makes a difference, however I have no choice..... I HAVE to compile it.

When I type the command notepad "C:\PROGRAM FILES\ADC LEGAL SYSTEMS INC\PERFECT PRACTICE INSTALL 02-06-08\APPS\ADCPP2\PERFPRAC\bin\ppHTTPLookup.ini" from a cmd prompt, notepad finds the file just fine, so I know all my pathing is correct.

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jun 24, 2009 7:41 pm

I replicated your path and found that you have a double space everywhere you have spaces including between "Program" and "Files". Check to make sure you have the correct number of spaces in the path directory names.

Otherwise with spaces in the script matching spaces in the actual path, if I run your script with quotes as you posted, it fails. If I remove the quotes, it works.

pasdad1
Junior Coder
Posts: 21
Joined: Wed Nov 17, 2004 1:09 am

long path problems

Post by pasdad1 » Wed Jun 24, 2009 7:52 pm

Must be something in the way you cut/pasted from the website....... There are only single spaces between the words. I just tried to replicate how you might have cut/pasted, and it still pasted as a single space for me.

I also just created that long path on the machine where I have MS installed so I could run it non-compiled, and it still fails with or without quotes.

Curious, what version of MS are you running?


Thanks for all your assistance so far!

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jun 24, 2009 8:00 pm

I'm on version 11.1.11 but I also tried it on version 10.1.21 and it works the same there. OS is Win XP SP3.

I cut and pasted from the code area of your original posting. If you place a cursor on the line wiht the path and move the cursor with the arrow keys you'll see there are double spaces everywhere you have spaces.

Browser is Firefox 3.0.11

User avatar
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Wed Jun 24, 2009 8:35 pm

Yup there are definitely double spaces in the quoted path.
Phil Pendlebury - Linktree

pasdad1
Junior Coder
Posts: 21
Joined: Wed Nov 17, 2004 1:09 am

long path problem

Post by pasdad1 » Wed Jun 24, 2009 8:51 pm

Well, thanks JRL !

Because this path is being passed in as a variable at runtime to the compiled EXE I was not readily accepting the obvious....

I did track it down to a bug in the external process that is setting the parameter for MS.


Thanks again for everyone's help.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts