Doppio Posted January 4, 2006 Share Posted January 4, 2006 This is my first post, I'm not too familiar with AutoIT, but for what I have seen, it looks awsome.I'm working on a bakup script, I want to be able to click on a Drive in (Folder Browser), and get the drive letter to show up on an Input box. I want just the drive letter C not C:\ . Can anyone help me?Any sugestions will be greatly appreciated. Link to comment Share on other sites More sharing options...
seandisanti Posted January 4, 2006 Share Posted January 4, 2006 This is my first post, I'm not too familiar with AutoIT, but for what I have seen, it looks awsome.I'm working on a bakup script, I want to be able to click on a Drive in (Folder Browser), and get the drive letter to show up on an Input box. I want just the drive letter C not C:\ . Can anyone help me?Any sugestions will be greatly appreciated. do you have any code written already? i mean just so we don't have to create the whole script to show you the one part you're interested in... if you know how to get C:\ then you could just StringLeft($that,1) to get the letter... Link to comment Share on other sites More sharing options...
Doppio Posted January 4, 2006 Author Share Posted January 4, 2006 do you have any code written already? i mean just so we don't have to create the whole script to show you the one part you're interested in... if you know how to get C:\ then you could just StringLeft($that,1) to get the letter...Here's the Code.Case $msg = $SelFolderBTN $Path = FileSelectFolder("Choose a folder.", "") GuiCtrlSetData($Textbox_1, $Path) Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 4, 2006 Moderators Share Posted January 4, 2006 (edited) I think this will work: $FullPath = FileSelectFolder("Choose a folder.", "") $ShortPath = StringLeft($FullPath, 1) GuiCtrlSetData($Textbox_1, $ShortPath) It does, you can test it with this: $FullPath = FileSelectFolder("Choose a folder.", "") $ShortPath = StringLeft($FullPath, 1) MsgBox(0, "Test", $ShortPath) Edited January 4, 2006 by big_daddy Link to comment Share on other sites More sharing options...
Doppio Posted January 4, 2006 Author Share Posted January 4, 2006 I think this will work: $FullPath = FileSelectFolder("Choose a folder.", "") $ShortPath = StringLeft($FullPath, 1) GuiCtrlSetData($Textbox_1, $ShortPath) It does, you can test it with this: $FullPath = FileSelectFolder("Choose a folder.", "") $ShortPath = StringLeft($FullPath, 1) MsgBox(0, "Test", $ShortPath) YESSSS, Thank you big_daddy, you just saved my day. 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