 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Sun Mar 14, 2010 3:08 pm Post subject: Over-written file recovery? |
|
|
Hi,
I use the FileCopy option, and What happened was I use to to replace my bookmarks in Google Chrome This is how it goes.
Bookmarks1=Everyday Use
Bookmarks2=Study+Work
When I Activate Script it would take
;---------- REPLACES EVERYDAY WITH STUDY
FileCopy "Bookmarks" (Everyday Use) and Paste it in same folder with name "BookmarksORIGINAL" (with over-write option being 1)
It would also...
FileCopy "BookmarksSTUDY" (Study+Work) and Paste it in same folder with name "Bookmarks" (with over-write option being 1)
;---------- END
Once I select the Switch option from the Tray menu again, it would
;---------- BRINGS BACK ORIGINAL BOOKMARKS (EVERYDAY)
FileCopy, "Bookmarks" (Study+Work) and Paste it in same folder with name "BookmarksSTUDY" (with over-write option being 1)
It would also...
FileCopy, "BookmarksORIGINAL" (Everyday Use) and Paste it in same folder with name "Bookmarks" (with over-write option being 1)
;---------- END
As you can see, it basically renames and rewrites the bookmarks between study and everyday use, but for some reason, today I noticed my Study bookmarks were replaced with the everyday use.
This meant that I had two copies of everyday use, and NO COPIES of study which is much more important.
I know that Google makes a bookmark backup names "bookmarks.bak" but that too has the everyday use ones.
I know I should have added a code that also backs up both of them.
So is there anyway that the file could be saved by system when overwritten? Like in the RECYCLER or something? I would do system restore, but I don't think it will bring back that original files, only settings.
Any advice will help
Thank you |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
|
| Back to top |
|
 |
Guest
|
Posted: Sun Mar 14, 2010 3:51 pm Post subject: |
|
|
Thanks for the reply, I'm running one a program at the moment, Ill see what I can find, and post progress.
Thanks |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 2214 Location: switzerland
|
Posted: Mon Mar 15, 2010 9:12 am Post subject: |
|
|
Copy example which not overwrites existing files (Add A_index to filename)
(creates test file and folder for test)
| Code: | MODIFIED=20100315
Filename=Copy_Example01.ahk
;-----------------------------
copy=y
FD1=c:\test11_SOURCE
FD2=c:\test12_DEST
F11=%fd1%\test11a.txt
F12=%fd1%\test11b.txt
ifnotexist,%fd1%
Filecreatedir,%fd1%
ifnotexist,%fd2%
Filecreatedir,%fd2%
ifnotexist,%f11%
Fileappend,test11a`r`n,%f11%
ifnotexist,%f12%
Fileappend,test11b`r`n,%f12%
;--------------------------------
total:=0
I6:=0
I7:=0
Loop, %FD1%\*.*,,1
{
;--------- COPYExample -----------------------
if (copy="y")
{
DX=%A_LoopFileFullPath%
SplitPath,dx, name, dir, ext, name_no_ext, drive
Filecopy, %DX%, %FD2%\%Name%
if errorlevel=0
{
I6++
TOT1=%TOT1%%DX%`r`n
}
If ErrorLevel ;-- There will be an errorlevel if the destination file exists
{
Loop
{
Filecopy, %DX%, %fd2%\%Name_no_ext%_%A_Index%.%ext%
if errorlevel=0
{
I7++
TOT2=%TOT2%%DX%`r`n
break
}
}
}
}
;-------------------------------------
}
Total:=(I6+I7)
tot3=%tot1%%tot2%
run,%fd2%
msgbox, 262208,Copy-TEST,Copied Total=%total%-Files`nFROM=%fd1%`nTO__=%fd2%`n-----------------`nFILES=`n%tot3%
return
|
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|