Jump to content
Sign in to follow this  
Ejaz

Folder Path

Recommended Posts

Ejaz

Hi Guys,

I am looking for a simple answer.

Want to have one directory which contain scripts and also within the main directories there are other folders which contain files.

I want to give the path of the specific file within the main folder.

Instead of absolute path like below

$App = "C:\sampleDirectory\dir2\app2.exe"

I want something like below

$App = "sampleDirectory\dir2\app2.exe" where the main script is in the "sampleDirectory" folder and the application is in the "dir2" folder. So that when the whole folder is distributed and the user where ever place the folder can run the programme.

Regards,

Ejaz

Share this post


Link to post
Share on other sites
big_daddy

I gave an example of using relative paths here.

Share this post


Link to post
Share on other sites
Ejaz

Look at @ScriptDir and similar @constants - macros

Thanks much,

For those who are new like me, following code work for me

$App = @ScriptDir & "\dir2\app2.exe"

Respect!!!

Ejaz

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×