Showing results for 
Search instead for 
Did you mean: 

Fixing javascript path issues


Fixing javascript path issues

I have a function that gets a path from the registry.


It is in the form C:\folder\folder\folder\


Unfortunately, this won't work in my javascript functions. It needs to be of the form



Is there a canned way to handle this, or do I have to write something convert this?

Community Hero

Re: Fixing javascript path issues


ACtually, it depends upon how you use it.  True, in JavaScript, if you want to hardcode a string to have the \ character, you need to double it.  But that isn't necessarily the case if you are reading text out of another location.  For example, Project.Path returns the location of the project file as a string.  This includes \ characters.  But I can use Project.Path in a filepath parameter without having to do any replacement.


Can you share the code that you're attempting to use the registry path from? It would be good to see how you're trying to use it... perhaps there's a better way that wouldn't have that problem.



Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

I’ll be talking about “Hidden Treasures – TestComplete Script Extensions” at #SBConnect in October! Who’s joining me? Click here for tickets
Extensions available

Re: Fixing javascript path issues

Hi Robert,


After looking at it, it was only the log that was showing the single \.


I should have checked via debugger first. It was correct.


I've been converting from DelphiScript to JavaScript and I'm still gettin used to the \\ thing



Share Your Stories
Read Latest News
Top Kudoed Authors