Page 1 of 1

Read Folder Path On Run

PostPosted: Mon Apr 24, 2017 12:04 am
by StarterPack
Hi guys...
What script can I use to read a Folder's path when i start my app

Thank You

Re: Read Folder Path On Run

PostPosted: Mon Apr 24, 2017 6:13 am
by Gaev
StarterPack:

Folder's path when i start my app

What (in your mind) is the difference between a Folder (name) and its Path ? ... please explain with an example.

Or were you looking for the Path of the Application ? ([PubDir]) ... or that of the Windows Temporary Folder ([TempDir]) ?

You can get the path of any file using ExtractFilePath e.g. ...
Code: Select all
ExtractFilePath "c:\a\b\any.file" "[myPath]"

... will return c:\a\b\ in [myPath].

Note that [i]any.file[/b] does NOT have to exist.

Re: Read Folder Path On Run

PostPosted: Mon Apr 24, 2017 2:56 pm
by StarterPack
Hi Gaev...

What I was trying to do is.... When I want to do a Reset (Clean All) on my App, it must Delete the Folder that is in my App and everything in it, and then create a new Folder. I can do that with the Call function (Call "Delete Folder.txt" "FolderPath") to delete the Folder and then use CreateFolder "[PubDir]MyFolder to create a clean Folder. But the call function doesn't understand [PubDir]. So I had to read the Folder's full path in a variable [FolderPath] and then tell Call function to delete that Folder. The ExtractFilePath works for me, Thank You. But when I use script on startup of my app (ExtractFilePath "[PubDir]MyFolder\" "[FolderPath]") then the call function doesn't find the path with the \ (backslash) in the end. How can I remove the last letter or in this case, the \ (backslash) from the variable

Thank You.

Re: Read Folder Path On Run

PostPosted: Mon Apr 24, 2017 3:08 pm
by StarterPack
Hi Gaev... I figured it out. Thank You

I use StrLen and StrDel to delete last letter.