Jump to content

Is there a folder open function?


gte
 Share

Recommended Posts

This is probably a dumb question and I must be searching on the wrong words for this, cause I know others have needed this :)

I want to open two folders after creating them in a gui

I can't find any functions like diropen or folderopen?

I tried this code, and even this is failing? Any thoughts

$todaysdate = "" & @mon & "-" & @mday & "-" & @YEAR
DirCreate("d:\hold\" & $todaysdate & " - Backup")
Run(""," start d:\hold\" & $todaysdate & " - Backup")
Link to comment
Share on other sites

How about this?

$todaysdate = "" & @mon & "-" & @mday & "-" & @YEAR
$sDir = "d:\hold\" & $todaysdate & " - Backup"
DirCreate($sDir)
Run("Explorer.exe /root," & $sDir)

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

maybe this:

Initiates a Open File Dialog.

FileOpenDialog ( "title", "init dir", "filter" [, options [, "default name" [, hwnd]]] )

Parameters

title Title text of the Dialog GUI.

init dir Initial directory selected in the GUI file tree.

filter File type single filter such as "All (*.*)" or "Text files (*.txt)" or multiple filter groups such as "All (*.*)|Text files (*.txt)" (See Remarks).

options [optional] Dialog Options: To use more than one option, add the required values together.

1 = File Must Exist (if user types a filename)

2 = Path Must Exist (if user types a path, ending with a backslash)

4 = Allow MultiSelect

8 = Prompt to Create New File (if does not exist)

default name [optional] Suggested file name for the user to open. Default is blank ("").

hwnd [optional] The window handle to use as the parent for this dialog.

Return Value

Success: Returns the full path of the file(s) chosen. Results for multiple selections are "Directory|file1|file2|..."

Failure: Sets @error to 1.

Remarks

Separate the file filters with a semicolon as shown in the example.

Multiple groups of filters are separated by a pipe "|".

If default name is given, options must also be given. If none of the options are wanted, use 0 for options.

Special Windows folders (such as "My Documents") can sometimes be set as the init dir; see Appendix.

@WorkingDir is changed on successful return.

Related

FileSaveDialog, FileSelectFolder, StringSplit

Example

$message = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($message, @WindowsDir & "\", "Images (*.jpg;*.bmp)", 1 + 4 )

If @error Then

MsgBox(4096,"","No File(s) chosen")

Else

$var = StringReplace($var, "|", @CRLF)

MsgBox(4096,"","You chose " & $var)

EndIf

; Multiple filter group

$message = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($message, @WindowsDir & "", "Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)", 1 + 4 )

If @error Then

MsgBox(4096,"","No File(s) chosen")

Else

$var = StringReplace($var, "|", @CRLF)

MsgBox(4096,"","You chose " & $var)

EndIf

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...