Sign in to follow this  
Followers 0
bobheart

choose folder

8 posts in this topic

I want to do some backups and I want to be abale to make the folder for the backup and where I can put the backup folder could someone show me how to use the open folder and save it to the script .

FileCopy (@WindowsDir & "\*.dll", "E:\backups\dlls", 1)

I have that hard coded in but would like to pick the folder and make it for the backup .

Thanks if you can help . sorry if this is a dumb question but i don't understand a lot of this .. :ph34r:

Share this post


Link to post
Share on other sites



I use fileopendiag and give instructions to select the folder or type in a new folder name. That way you control the main folder to some degree as well.

Rick


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
Share on other sites

Not sure how to do that ?

Share this post


Link to post
Share on other sites

Not sure how to do that ?

In the help file it shows the switches at the end you can use to allow a file that does not exist to be written in

after doing that use dircreate to make it a folder instead.

This way if the folder already exists the user will select it and direcreate will have no effect

Rick


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
Share on other sites

bobheart, what about this?

GUICreate("BUP", 320, 280)
$label1 = GuiSetControl("label", "",  10, 10, 300, 20, 0x1000)
$choose = GUISetControl ("button", "Choose Folder", 10,40,100,20)
GuiSetControlNotify()
$md = GUISetControl ("button", "Make Folder", 10,60,100,20)
GuiSetControlNotify()
;----------------------------------------------------------

GuiShow()
While GUIMsg() <> -3
$msg = GuiRead()
Select

;------------------
Case $msg = $choose
$backup_path = FileSelectFolder("Choose Backup Dir", "", 0)
GuiWrite($label1,0,"Backuppath: " & $backup_path)

;------------------
Case $msg = $md
$new_folder_name = InputBox("New Folder", "Enter new Foldername:")
$where_to_put = FileSelectFolder("Where to create new Folder?", "", 0)
$ret = DirCreate($where_to_put & "\" & $new_folder_name)
If $ret = 1 Then
$backup_path = $where_to_put & "\" & $new_folder_name
GuiWrite($label1,0,"Backuppath: " & $backup_path)
Else
MsgBox(0, "!!!", "Error!")
EndIf

;---------
EndSelect
Wend

Just an example. No errorhandling.

arctor

Share this post


Link to post
Share on other sites

Probably best not to give beta code examples for problems...

Is there some reason that FileSelectFolder isn't useful, bob? That's what it is there for...selecting folders.

Share this post


Link to post
Share on other sites

All have to giveit a try and see if I can get it to work .. thanks for the help .

Share this post


Link to post
Share on other sites

Probably best not to give beta code examples for problems...

That's right. Sorry. My mistake. Just realized this is not the Gui Forum.

arctor

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