DonationCoder.com Software > Post New Requests Here
Replace existing file with zero byte version with slight name change
skwire:
Please test this AutoHotkey snippet on some copies of your files first. Change the variables as needed.
--- Code: Autohotkey ---; DO NOT put this script in the same folder as the files to be renamed. ; Variables.bRecursive := FALSE ; Change to TRUE if desired.sPath := "c:\tmp\11\*.*" ; Change as necessary. ; Process files.Loop, % sPath, 0, % bRecursive ; Iterate over files.{ ; Crack filepath. SplitPath, A_LoopFileFullPath, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive If InStr( OutFileName, " [PLACEHOLDER]" ) ; If " [PLACEHOLDER]" exists in filename. { ; Strip out " [PLACEHOLDER]" text from original filename. StringReplace, OutNameStripped, OutNameNoExt, %A_Space%[PLACEHOLDER], ; Create zero-byte file with new name & extension. FileAppend, % "", % OutDir . "\" . OutNameStripped . ".placeholder" ; If new file creation was successful, delete original placeholder file. If ! ( ErrorLevel ) { FileDelete, % A_LoopFileFullPath } }} MsgBox, Done.
magician62:
Hi Jody, as it's getting late in the evening, will test in the morning and report back, many thanks.
Also you may not have seen my bug comment on Files2Folders, , last page
https://www.donationcoder.com/forum/index.php?topic=19770.msg393594
magician62:
So I went ahead and tried it, and although a little sleepy I got their in the end, was having issues with sPath syntax. I have now added multiple replacements as I realised I hade used more than one coding. Many thanks for your help.
4wd:
robocopy <source> <dest> /CREATE /E /np /nfl /ndl /njh /njs
eg. robocopy D:\harry K:\fred /CREATE /E /np /nfl /ndl /njh /njs
That will create an exact copy of a directory tree populated with zero byte files in a very short time, (usually a few seconds).
Then you can use a bulk renamer afterwards if you want another alternative.
skwire:
So I went ahead and tried it, and although a little sleepy I got their in the end, was having issues with sPath syntax. I have now added multiple replacements as I realised I hade used more than one coding. Many thanks for your help.-magician62 (December 26, 2015, 04:47 PM)
--- End quote ---
Great to hear. Thank you for the donation as well. Much appreciated.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version