olirav Posted April 16, 2010 Share Posted April 16, 2010 How can I get the drive that the script/exe is currebtly running from (Probably stupid question) Oli Link to comment Share on other sites More sharing options...
kaotkbliss Posted April 16, 2010 Share Posted April 16, 2010 (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 April 16, 2010 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
l3ill Posted April 16, 2010 Share Posted April 16, 2010 Have a look at the Macro Reference/ Autoit related Macros: @ScriptDir My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
olirav Posted April 16, 2010 Author Share Posted April 16, 2010 thanks for the quick responce, I am just trying it out Link to comment Share on other sites More sharing options...
olirav Posted April 16, 2010 Author Share Posted April 16, 2010 (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 April 16, 2010 by olirav Link to comment Share on other sites More sharing options...
kaotkbliss Posted April 16, 2010 Share Posted April 16, 2010 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 gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
l3ill Posted April 16, 2010 Share Posted April 16, 2010 (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 April 16, 2010 by billo My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
olirav Posted April 16, 2010 Author Share Posted April 16, 2010 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 Link to comment Share on other sites More sharing options...
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