apbonn Posted March 2, 2020 Posted March 2, 2020 I ve got a problem. I ve got an absoult path but i want a relative. Like $string = "C:\doc\emu\word\path\path\2" I know the working folder of my script $workingFolder = @ScriptDir // C:\doc\emu\word So what i want is $result = "path\path\2" So the easiest way would be to substract workingFolder of $string and the result is the remaing part. But i cant figure out how to do that. any ideas?
Subz Posted March 2, 2020 Posted March 2, 2020 Just use StringReplace($string, "C:\Doc\emu\word", @ScriptDir)
apbonn Posted March 2, 2020 Author Posted March 2, 2020 the result is everything without "path\path\2" but i i neet exactly the differnt result. i just want "path\path2\"
Subz Posted March 2, 2020 Posted March 2, 2020 Sorry I actually meant use StringReplace($string, @ScriptDir & "\", "")
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now