Masen

Change path

7 posts in this topic

#1 ·  Posted (edited)

ok im trying to write a script to change a path from default path to what the user would wanna change it to.

so this is the default path :  |||   "C:\Users\masen\Desktop\Database"  |||

and if they go into the admin page on the program. and decide to change the path there to let says

 "C:\Users\masen\Desktop\HOME"

considering the User does not know how to write script.

so this would be more of an option for the user on the admin page.

were would i begin to get this script going.

thx in advance

Func Folders()
     $message = ("Click Shift to Select Multiple files.")
    $var = FileOpenDialog($message, "C:\Users\masen\Desktop\Database" & "\", "Pictures (*.jpg; *.bmp; *.png; *.gif)|Videos (*.avi; *.mpg)|Txt (*.txt)", $FD_FILEMUSTEXIST + $FD_MULTISELECT)
    $file = FileRead($var)
    If @error Then
        Else
    endif

        MsgBox(0, "", "No File(s) were selected")
EndFunc   ;==>Example

 

Edited by Melba23
Altered title

Share this post


Link to post
Share on other sites



Masen,

I notice all your threads are entitled "Need help" or something pretty close. Everyone who posts here needs help - it goes without saying - so could you please give more descriptive titles to your threads in future. Thanks for your cooperation in this.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

yea alright so what would this thread be considered to be called?

 

o nvm i see u did it alrdy thx

Edited by Masen

Share this post


Link to post
Share on other sites

If i got the problem right.. You can set a variable to default path in fileopendialog.

Set the variable with fileselectfolder for example

Local $sFileSelectFolder = FileSelectFolder('Title', "")
$var = FileOpenDialog('Title', $sFileSelectFolder & "\", "Txt (*.txt)")

 


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If you use the $FD_MULTISELECT flag with FileOpenDialog, you have to split the returned string (using | as delimiter). See the helpfile, in the Return section :

https://www.autoitscript.com/autoit3/docs/functions/FileOpenDialog.htm

 

Edited by jguinch

Share this post


Link to post
Share on other sites
3 hours ago, careca said:

If i got the problem right.. You can set a variable to default path in fileopendialog.

Set the variable with fileselectfolder for example

Local $sFileSelectFolder = FileSelectFolder('Title', "")
$var = FileOpenDialog('Title', $sFileSelectFolder & "\", "Txt (*.txt)")

yea that works great now i just got to get that specific folder to save it to make sure i remembers that path that the users chooses

Share this post


Link to post
Share on other sites

Save to ini for example.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

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