Sign in to follow this  
Followers 0
Doppio

Help getting the drive letter

5 posts in this topic

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. :P

Share this post


Link to post
Share on other sites



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. :P

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...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by big_daddy

Share this post


Link to post
Share on other sites

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. :P

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