xcopy

Copy file to destination folder and keep duplicates

不羁岁月 提交于 2020-05-28 05:30:26
问题 How do I copy a certain file to a destination folder that already has the same file with the same name, keep both files. For eg. if a.jpg is already present in the destination folder (assume one in number), now there would two files with different names (eg. a.jpg and a(1).jpg 回答1: We can also use TIMESTAMP: @echo off for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%" set

Copy file to destination folder and keep duplicates

送分小仙女□ 提交于 2020-05-28 05:30:20
问题 How do I copy a certain file to a destination folder that already has the same file with the same name, keep both files. For eg. if a.jpg is already present in the destination folder (assume one in number), now there would two files with different names (eg. a.jpg and a(1).jpg 回答1: We can also use TIMESTAMP: @echo off for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%" set

Windows batch copy files from subfolders to one folder

ぃ、小莉子 提交于 2020-01-22 09:01:26
问题 I had tried to make batch script that copies all *.tif files located in D:\images(random named subfolders here) to d:\all. xcopy D:\Downloads\*.TIF D:\temp\ /s works, but it copies with all folder tree. I tried to use other keys, but its dont works. Thanks for help! 回答1: FOR is your friend. Read HELP FOR on the /R option and the %~nx variable substitution; and then try this very simple code. pushd d:\downloads for /r %%a in (*.tif) do ( echo COPY "%%a" "d:\temp\%%~nxa" ) popd watch carefully

Moving and renaming files, keeping extension but include sub directories in batch file

可紊 提交于 2020-01-16 18:20:07
问题 Forgive me if this is nor the place to ask these questions, I am new to batch and scripts and a bit new to these kind of posts... I have a folder that will receive files and folders, I want to run a script that looks at the directory and renames all files in each subfolder numerically, and moves them if possible. For example I have something that looks like the following Recieved_File_Folder |_folder1 | |_file1.txt | |_file2.bmp |_folder2 | |_file4.exe | |_file5.bmp |__file9.txt |__file10.jpg

File.lastModified() painfully slow!

烈酒焚心 提交于 2020-01-14 10:22:49
问题 I'm doing a recursive copy of files and like xcopy /D I only want to copy newer files destination files (I cannot use xcopy directly since I need to alter some files in the copy process). In java I use lastModified() to check if the destination file is older than the source file and it's very slow. Can I speed up the process (maybe using JNI??)? Are there any other copy scripts that can do the job better (copy new files + regexp change some text files)? Copying files anyways is not an option

File.lastModified() painfully slow!

我们两清 提交于 2020-01-14 10:21:12
问题 I'm doing a recursive copy of files and like xcopy /D I only want to copy newer files destination files (I cannot use xcopy directly since I need to alter some files in the copy process). In java I use lastModified() to check if the destination file is older than the source file and it's very slow. Can I speed up the process (maybe using JNI??)? Are there any other copy scripts that can do the job better (copy new files + regexp change some text files)? Copying files anyways is not an option

qmake command to copy files and folders into output directory

≡放荡痞女 提交于 2020-01-14 07:59:06
问题 I'm developing an app that should build on Windows, Linux and OS X using QtCreator and Qt 5.3. I want to copy all files and subfolders from a folder into output folder. I've got it working for Linux and OS X, but not for Windows. Here's the relevant section of my .pro file: win32 { PWD_WIN = $${PWD} DESTDIR_WIN = $${OUT_PWD} copyfiles.commands = $$quote(cmd /c xcopy /S /I $${PWD_WIN}\copy_to_output $${DESTDIR_WIN}) } macx { copyfiles.commands = cp -r $$PWD/copy_to_output/* $$OUT_PWD } linux {

Batch file to copy files from folders&sub folders using a file list only if file size greater than

此生再无相见时 提交于 2020-01-07 03:59:12
问题 We have images of our warehouse stock within our database. We will pull a list of the file names for those images into a .txt file. The content of the file-list.txt will be for example: 060128412948.jpg 068912475982.jpg etc. We have 3 images for each stock 2 of them are low resolution and 1 of it is a high resolution image. I need the script to only copy the high resolution image for each stock from the folders/sub-folders into a mother directory. This is what I have so far but this only

【cmd】cmd常用命令

╄→гoц情女王★ 提交于 2020-01-04 23:51:44
dir 是英文单词directory(目录)的缩写,主要用来显示一个目录下的文件和子目录 md 是英文make directory(创建目录)的缩写 cd 是英文change directory(改变目录)的缩写 ( 如果目录有空格需要加引号,例如:C:\Program Files\MySQL>cd "MySQL Server 5.7" ) mv 移动文件,也可以重新命名   (MV ./雷龙/12.15.docx 12.15改过.docx) copy 在英文中是复制的意思 touch  创建文件 rd remove directory--删除目录,注意两条:一是不能删除非空目录;二是不能删除当前目录 del 删除文件,是英文delete(删除)的缩写,注意这个命令不能删除具有只读、隐含、系统属性的文件;如果指定文件不存在,则出现“File not found”的提示;DOS对误删除的文件可以用UNDELETE外部命令恢复;它只能删文件,不能删目录。   例如:删除当前目录及子目录下以java结尾的文件 E:\xiangmu\Exam1\Exam\src\main\resources\cn>del /s *.java ren 是英文rename(重新命名)的简写 Osk:软键盘 Calc 计算器 Psr 屏幕步骤录制 cleanmgr 清空磁盘 Control 控制面板

Having XCopy copy a file and not overwrite the previous one if it exists (without prompting)

时间秒杀一切 提交于 2020-01-01 07:31:06
问题 I'm sending a commands to a remote computer in order to have it copy a file. I want the file to be copied, but not to overwrite the previous file with the same name (if it exists). I also need the command to run without any prompts (xcopy likes to prompt whether the target name I've specified is file or directory, and it will also prompt about overwriting a file). 回答1: No way to make it NOT overwrite as far as I know. but /Y will make it overwrite. and /I will get rid of the file/dict prompt.