I have around 200 files with updated version and a lot of subfolders. I need to replace those files into another directory that have same filenames, but older version and also a lot of subfolders, but with different names. Is there a way to do it?
I have tried to use:
replace "filepath1"\*.* "filepath2" /s /u
Did not worked. As I understand, it can replace if my filepath1 does not have subfolders, but only files available.
I can just pick all those files from Search function and add to different folder, but I am bored and wanted to know if I can do it without adding files into one folder.
I hope someone understands what I want.
Thanks
Related
So, I was hit with the Cryptowall 3.0 ransomware virus. After decryption I am still left with a large amount of DECRYPT_HELP files in .txt, .html, .png and Windows Shortcut formats.
I need a batch script to recursively find the files containing the name "DECRYPT_HELP" regardless of its' extension and move those files into a directory which I will delete.
I am a Linux guy, so I can't FIND and GREP my way through this. Any assistance would be appreciated.
You can find the files using
dir /s *decrypt_help*
dangerous command follows
del /s *decrypt_help*
will delete all of those files. use with extreme caution
I would like to be able to copy all files from various folders and combine them into a single folder using a Windows batch file. That is fairly easy to do for me. But if the file already exists on the destination, I would like it to only override the file if it's newer.
copy c:\pics\ to d:\
Thanks.
You can use xcopy for more options if the source dirs are 2-3-5 (write separate xcopy lines for each). If the dirs are too many, you can use archiver like WinRar (or its command line rar.exe) with #list option where are stored the source dirs. In the batch file call RAR 2 times - first to pack all source files to one archive, then to unrar them in single folder (with E option, not X). Finally, you delete the .rar file. See the extra options to skip older files, omit prompts, etc.
Anyone know of a utility that exists which can traverse a solution file (.sln) and all of its project files and create a zip (archive) of that? My google-fu is failing me on this one, there are too many results showing how to write a program to zip files.
If you have 7zip installed, you can create a batch file to do what you want.
Create a file called archive.bat in the solution directory, open it and add:
"c:\program files\7-zip\7z.exe" a -tzip archive.zip * -xr#archive.ignored
Then create a text file called archive.ignored (in the same location as the .bat file) that lists the filenames/wildcards to be excluded from your archive.zip. For example:
obj
debug
bin
packages
*.obj
*.dll
*.exe
*.zip
*.suo
.vs
archive.ignored
archive.bat
CleanProject almost does what I want, but it doesn't actually read the .sln file so you need to have the relevant projects in the solution folder, and this grabs everything in those folders (cleaning up somethings you wouldn't want in the zip), whether they are referenced in the solution or not.
You should be able to accomplish that by creating a WinZip job. It's a one time setup where you define what, where, and when to create a zip file. I've used it to automate some backup tasks.
I would like to creat a batch file that will recognise folders date moidified in a network drive and then copy them to another network drive
while I was searching I found way to do that to files, but I need it for folders
I didn't find a way to do that
Sadly, you didn't say which method you'd found. If that method selects the files using a DIR.../a-d... structure for instance, then omit the - before the d and directories matching the selected pattern rather than files would be processed.
To create a batch file just get notepad++ and save as a .bat, is that what you meant? or did you want a certain type of Batch file, because I didn't think there was another type unless you count Command prompt and Notepad++ different?
Forfiles may be helpful, or robocopy
This will create a mirror backup in the destination folder. If files are deleted in the source then they will also be deleted in the destination.
#echo off
robocopy "\\172.172.172.10\folder" "\\172.172.172.2\destination" /mir
I have a folder containing many other sub-folders.
I am trying to write a batch file which will copy some of the folders to another place on my hard disk. I am using "xcopy" for this. I am facing following problem:
The folder structure is as shown below-
--FolderB1
---FolderB2
---FolderB22
---File1.txt
---File2.txt
---File3.txt
I have some .txt files inside "FolderB1", along with "FolderB2" and
"FolderB22" I want to copy "FolderB2" and "FolderB22" and skip ".txt"
files contained in "Folder B1"
I tried using /EXCLUDE: param of xcopy command, but it is not able to perform this operation. It does not work if I specify the exclusion as \FolderB1\*.txt or something of this sort.
The number of main folders is not known. It can be anything. Also, there is no fix pattern for names of ".txt" files. Have checked this question too, but did not help.
Alternate method or other pointers for the same would be a great help. Thanks in advance.
What you could try to do is to hide the files you don't want to copy, then execute the xcopy, and then unhide the files again.
Look at my answer of question Windows batch script to delete everything in a folder except one. That question was related do deleting files (excluding some files), but you can probably use the same trick for xcopy-ing files.