cancel
Showing results for 
Search instead for 
Did you mean: 

How to run a bat file with a relative path?

SOLVED
Occasional Contributor

How to run a bat file with a relative path?

Hi,

 

I wonder how can I run a bat file from a relative path?

 

Our Testsuite is located in a git repository which results in different absolute paths per user.

Our folder structure looks like:

root

root/Scripts/MyBat.bat

root/TestComplete/suite.pjs

root/TestComplete/suite/foo.mds

etc.

 

I'd like to run the root/Scripts/MyBat.bat out of a keyword in root/TestComplete/suite/KeywordTests/

 

How can I achieve this without using an absolut path to MyBat.bat ?

 

Thank you and kind Regards

TestedOrange

1 ACCEPTED SOLUTION

Accepted Solutions
Occasional Contributor

Re: How to run a bat file with a relative path?

Thanks for your feedback.

 

I solved it by writing a routine using aqFileSystem.GetCurrentFolder() and aqFileSystem.GetFolderInfo().ParentFolder.

View solution in original post

5 REPLIES 5
Community Manager

Re: How to run a bat file with a relative path?

Hi @TestedOrange,

 

You need to play with ..\ or %CD%

 

It's mostly a question to system admins

---------
Tanya Gorbunova
SmartBear Community Manager

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!
Community Hero

Re: How to run a bat file with a relative path?

I'd go with @TanyaGorbunova 's suggestion.  It's probably the easiest to implement.


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.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Community Manager

Re: How to run a bat file with a relative path?

Hi @TestedOrange,

 

Did you find the solution to the issue? Please share what you decided to use finally.

---------
Tanya Gorbunova
SmartBear Community Manager

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!
Occasional Contributor

Re: How to run a bat file with a relative path?

Thanks for your feedback.

 

I solved it by writing a routine using aqFileSystem.GetCurrentFolder() and aqFileSystem.GetFolderInfo().ParentFolder.

View solution in original post

Community Manager

Re: How to run a bat file with a relative path?

Great to hear that the issue is resolved. And thanks for sharing it with us!

---------
Tanya Gorbunova
SmartBear Community Manager

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!