bobheart Posted July 23, 2004 Share Posted July 23, 2004 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 .. Link to comment Share on other sites More sharing options...
tutor2000 Posted July 23, 2004 Share Posted July 23, 2004 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 Link to comment Share on other sites More sharing options...
bobheart Posted July 23, 2004 Author Share Posted July 23, 2004 Not sure how to do that ? Link to comment Share on other sites More sharing options...
tutor2000 Posted July 23, 2004 Share Posted July 23, 2004 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 inafter 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 effectRick Link to comment Share on other sites More sharing options...
Arctor Posted July 23, 2004 Share Posted July 23, 2004 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 Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 23, 2004 Administrators Share Posted July 23, 2004 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. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
bobheart Posted July 23, 2004 Author Share Posted July 23, 2004 All have to giveit a try and see if I can get it to work .. thanks for the help . Link to comment Share on other sites More sharing options...
Arctor Posted July 23, 2004 Share Posted July 23, 2004 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now