Sign in to follow this  
Followers 0
pooorboy

Check for and create a directory

5 posts in this topic

I am having a hard time to check to make sure a directory exists. Here is the program. I am running it on windows XP.

ifexist, "%allusersprofile%\\Application Data\\Spybot - Search & Destroy", goto, Copy

FileCreateDir, "\\%allusersprofile%\\Application Data\\Spybot - Search & Destroy\\"

Copy:

FileCopy, "g:\\apps\spynet\\configuration.ini", "%allusersprofile\\Application Data\\Spybot - Search & Destroy"

exit

What am I doing wrong?

Share this post


Link to post
Share on other sites



can't be this easy, could it?

<{POST_SNAPBACK}>

Thanks for seeing the error. However, that is not the main problem. The directory does exist yet it does not jump to COPY:. It proceeds to the next line. The next line, if the the directory does not exists, is not created. So line 2 doesn't work either. Is my syntax wrong?

Share this post


Link to post
Share on other sites

Thanks for seeing the error. However, that is not the main problem. The directory does exist yet it does not jump to COPY:. It proceeds to the next line. The next line, if the the directory does not exists, is not created. So line 2 doesn't work either. Is my syntax wrong?

<{POST_SNAPBACK}>

what about the missing "\\" infont of the filepath ?

ifexist, "\\%allusersprofile%\\Application Data\\Spybot - Search & Destroy", goto, Copy

FileCreateDir, "\\%allusersprofile%\\Application Data\\Spybot - Search & Destroy\\"


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

what about the missing "\\" infont of the filepath ?

ifexist, "\\%allusersprofile%\\Application Data\\Spybot - Search & Destroy", goto, Copy

FileCreateDir, "\\%allusersprofile%\\Application Data\\Spybot - Search & Destroy\\"

<{POST_SNAPBACK}>

Nope, doesn't work that way either. Can anyone try this and let me know if it works for them. Thanks

Share this post


Link to post
Share on other sites

try...

ifexist,%allusersprofile%\\Application Data\\Spybot - Search & Destroy, goto, Copy

<{POST_SNAPBACK}>

Thank you very much. That did it.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0