Locate Script Path
Forums
Hi Brian,is it possible to find out at which path the script is running, so I can save the value in a variable.Thanks
Thank you for the quick
Thank you for the quick response, but this is not what I'm talking about. I want to save the directory of my IDEA-script in a variable not the working directory of my IDEA-project. I have a folder structer with several scripts. There is also one start script, where you can navigate to other scripts dependent of your choise. If I distribute this folder structure with the scripts to a user, it should be possible to run the script and navigate through all scripts. I don't want to pretend a fixed directory where all scripts have to be. That's why I want to save the directory of the script in a variable to handel the navigation dynamicly.
Hi, I am from Berlin (Germany
Hi, I am from Berlin (Germany).
Because I have the same problem, I've tried some VB-script-tips from the web:
Solution 1: with WScript..
Set fso = CreateObject("Scripting.FileSystemObject")
WScript.Echo fso.GetParentFolderName(WScript.ScriptFullName)
Solution 2: with WScript...
With WScript
MyPath = Replace(.ScriptFullName&":", .ScriptName&":", "")
.Echo MyPath
End With
Solution 3: without WScript...
Set fso = CreateObject("Scripting.FileSystemObject")
sPath = fso.GetFolder(".") & "\"
My problem(s): Solution 1 + 2 doesn't work, because WScript is deactivated on our Laptops...
and Solution 3 doesn't work sure (the result is not ever correct).
wisonix
I have the same question.
I have the same question.
For example I have my .iss file saved on desktop, and my goal is to obtain the path of this file, something like "C:\Users\xxx\Desktop\".
at this time I only can get the name of the current IDEA project when I run both codes that I share below:
MsgBox Client.WorkingDirectory()
Set WScript = CreateObject("WScript.Shell")
MsgBox WScript.CurrentDirectory
any of you have solved this issue?
I suggest to use a special *.
I suggest to use a special *. ini file were the path is set manually. Your macros could read that file and use the given path.
edit: I use the path of the Local Library to save that *.ini file. You will get that path with Client.LocalLibraryPath(). When the script runs for the first time and doesn't find that *.ini file a dialog to set the paths is shown.
Hi tme and welcome to the
Hi tme and welcome to the site.
Are you talking about the project folder, there is a command that will return the path of your project which would generally be where the script is running. You can find it with the following command:
Current = Client.WorkingDirectory()
Let me know if I understood what you are looking for.
Thanks
Brian