6/15/2023 0 Comments Windows echo pathThere is a built-in variable dp0 which expands to the path that the script is located in including the trailing slash. ![]() Windows Batch Windows batch is the trickiest in some ways it also is the one that cannot support UNC working directories. Diamant software film restoration suite free downloadĪs a reference for myself this post gives the template for getting the current script directory in the languages I tend to use: PowerShell, VBScript and batch. ![]() The best way to get around this is to determine the directory that the script resides in at the start of the script and then make all other paths reference that.īecause I jump around various scripting languages all the time, I tend to forget the best way to do this and have to hunt for examples in old scripts. One way around this is to make the script change working directory right at the start and then use relative paths after that. ![]() Depending on how the script is called the working directory may not be the same as the script file.įor example, if your current directory is C:Windows and you run the script serversharesomepathmyscript.cmd then any relative paths in the script file wont work correctly.
0 Comments
Leave a Reply. |