Sign in to follow this  
Followers 0
olirav

Simple question (Get running location)

8 posts in this topic

How can I get the drive that the script/exe is currebtly running from

(Probably stupid question)

Oli

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@ScriptDir

*edit*

if you just want the drive letter, you will have to trim everything else off as that macro gives the full path

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

thanks for the quick responce, I am just trying it out

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Works great, new question now though, how can I trim it to only the drive letter, I've looked at StringTrim Left/Right but that wouln't do it.

(Only a problem as the location can change, so cant use trim right.)

oli

Edited by olirav

Share this post


Link to post
Share on other sites

StringInStr, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper and StringSplit

You won't need all of those, but there are many ways to do what you want, find a combination that works for you :(


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Strings are new ground for me too so I tried this...

$var = @ScriptDir 
$array = StringLeft($var, 1)
ConsoleWrite("var=" & $var & @CRLF) 
ConsoleWrite("$array=" & $array & @CRLF)

works nice and easy ::(

Edited by billo

Share this post


Link to post
Share on other sites

Strings are new ground for me too so I tried this...

$var = @ScriptDir 
$array = StringLeft($var, 1)
ConsoleWrite("var=" & $var & @CRLF) 
ConsoleWrite("$array=" & $array & @CRLF)

Works Great

thanks billo, and kaotkbliss also for your help

oli

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  
Followers 0