John-Paul Posted January 10, 2005 Share Posted January 10, 2005 (edited) How does one search for a directory only. ie: if dir exists DIR then ...... I have found the FileExists function and there does not seem to be a Directory Exists and not being too code fantasic I have not found a simply way to do it. I only want to check if a directoory exists and if so the script will run, if not then the script will exit. Basically I want to back up my files after a certain event (system shutdown) and so I want to see if a previous backed up directory exists then I will rename it by using the Move Dir function as there's no rename function and once moved then continue with backing up the files, plus relabel directory 3 times so that i have 4 backed up versions. ie: Backup Backup_1 Backup_2 Backup_3 Thanks, Jp Edited January 10, 2005 by John-Paul Link to comment Share on other sites More sharing options...
Helge Posted January 10, 2005 Share Posted January 10, 2005 (edited) Try to use the search functions combined with FileGetAttrib()..Edit : oops...maybe not exactly what you wanted..Try something like this :If FileExists("c:\windows\") Then MsgBox(64,"","wow!") Else MsgBox(64,"","what the..") EndifGood luck ! Edited January 10, 2005 by Helge Link to comment Share on other sites More sharing options...
John-Paul Posted January 10, 2005 Author Share Posted January 10, 2005 Thanks, and I recognise that I posted it here in the Scripts section and may have placed it in the general section, so hope no one is too upset.jp.Try to use the search functions combined with FileGetAttrib()..Edit : oops...maybe not exactly what you wanted..Try something like this :If FileExists("c:\windows\") Then MsgBox(64,"","wow!") Else MsgBox(64,"","what the..") EndifGood luck !<{POST_SNAPBACK}> 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