Sign in to follow this  
Followers 0
SirDarknight1200

Preventing to create another directory

5 posts in this topic

If I use the following code :

Case $msg = $Button6
     DirCopy(@HomeDrive & "\Windows\Temp\", @MyDocumentsDir & "\Backup\")

Each time the button is clicked, the directory will be recreated,how can I do that if the directory already exists then it won't create another one

Share this post


Link to post
Share on other sites



Hi,

The source and destination parameter for DirCopy should not have a trailing backslash, so it should:

DirCopy(@HomeDrive & "\Windows\Temp", @MyDocumentsDir & "\Backup")

 

Use FileExists() to check if a file OR directory exists or not

Share this post


Link to post
Share on other sites

Thanks a lot! Both of u

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