| View previous topic :: View next topic |
| Author |
Message |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Thu May 27, 2004 6:31 pm Post subject: FileCreateDir with variables |
|
|
| Code: | FileCreateDir, c:\%a_year%%a_mon%%a_mday%
MsgBox, Errorlevel = %errorlevel% |
This always returns Errorlevel = 1. I also tried saving the date to a variable and just using that variable and that did not work either.
| Code: | FileCopy, Temp.exe, c:\newfolder\Temp.exe, 1
MsgBox, Errorlevel = %errorlevel% |
This probably belongs in the Wish List, but if the folder newfolder does not exist it will not create it. If the Overwrite Flag is there could this be an option to create the directory as well?
thanks,
beardboy |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Thu May 27, 2004 6:38 pm Post subject: |
|
|
I can always use DOS to do this:
| Code: | | RunWait, %comspec% /c md c:\%a_year%%a_mon%%a_mday% |
But I prefer to use AutoHotkey functions when I can.
thanks,
beardboy |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu May 27, 2004 8:14 pm Post subject: |
|
|
| Quote: | FileCreateDir, c:\%a_year%%a_mon%%a_mday%
MsgBox, Errorlevel = %errorlevel% |
That example works on my system. Perhaps the directory already exists, there is a file of that same name, or the user lacks the permission to create a directory there?
| Quote: | | .. but if the folder newfolder does not exist it will not create it. If the Overwrite Flag is there could this be an option to create the directory as well? |
That sounds like a good option, I'll put it on the infamous to-do list. |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Thu May 27, 2004 8:55 pm Post subject: |
|
|
| Quote: | | That example works on my system. Perhaps the directory already exists, there is a file of that same name, or the user lacks the permission to create a directory there? |
Oops, with my FileCopy testing I had created a file with that name by accident, and it was sitting at the bottom of my explorer window. Thanks for pointing out my mistake.
thanks,
beardboy |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu May 27, 2004 9:55 pm Post subject: |
|
|
Thanks for rechecking it.
Never feel sorry for misreporting a bug. Even if you turn out to be wrong, so many people stay silent when they see something weird that some bugs go unfixed for a long time. |
|
| Back to top |
|
 |
|