Jump to content
Sign in to follow this  
mulletmandan

Creating a Folder Using an Input Box

Recommended Posts

mulletmandan

I have searched through the AutoIt3 Help Files and this forum, and haven't found what I'm looking for. I would like to create a custom folder in C:\My Documents\My Pictures\*Custom Folder Here*. I am creating a script to scan photos, and I discovered the DirCreate function, but cannot figure out how to create a folder based on a string from an input box. Any help?

Thanks!

Share this post


Link to post
Share on other sites
Josbe

I have searched through the AutoIt3 Help Files and this forum, and haven't found what I'm looking for. I would like to create a custom folder in C:\My Documents\My Pictures\*Custom Folder Here*.  I am creating a script to scan photos, and I discovered the DirCreate function, but cannot figure out how to create a folder based on a string from an input box.  Any help?

Thanks!

<{POST_SNAPBACK}>

A small example:

$sDirName = InputBox("Create a dir", "Write the directory name", "A default name", '', 10, 10)
$path = "C:\My Documents\My Pictures"

If NOT @Error Then
    $sFullDirName = $path & "\" & $sDirName
    If DirCreate( $sFullDirName ) Then
        MsgBox(0, "Success", "Directory was created!" & @LF & $sFullDirName)
    Else
        MsgBox(0, "Error", "Directory wasn't created")
    EndIf
EndIf

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.