xcopy

How to copy the two most recent log files to another folder?

不打扰是莪最后的温柔 提交于 2019-12-24 07:42:13
问题 I am trying to copy the two most recent error logs from a source location to another folder which is easier to access. I found the code below on Magoo's post here and the instructions were to replace echo %%i with the appropriate copy command. I am having a hard time with that for some reason. @ECHO OFF SETLOCAL SET transfer=xx FOR /f "delims=" %%i IN ('dir/b/a-d/o-d *.*') DO IF DEFINED transfer CALL SET transfer=%%transfer:~1%%&ECHO %%i My final line with the echo %%i replaced looks like

Windows xcopy is not working in python

僤鯓⒐⒋嵵緔 提交于 2019-12-24 00:57:12
问题 When I am doing xcopy "D:\Accessories\My File\read-me.rtf" "D:\Any Folder\Destn" It is copying fine Same thing I am doing in python (2.7) import os source = "D:\Accessories\My File\read-me.rtf" target = "D:\Any Folder\Destn" output = os.system ("xcopy %s %s" % (source, target)) But this code is throwing error that Invalid number of parameters Is it a right way to invoke ? Any suggestion ? 回答1: There are spaces in your "source" and "target" pathnames. Try quoting it in the os.system call ie

xcopy is not recognized as an internal or external command, operable program or batch file

放肆的年华 提交于 2019-12-21 06:49:03
问题 I have a problem using 'xcopy' command. I'm building a C# project with msbuild. At the end of the build, a batch file is called to copy my assemblies from Debug/Release to some other folders. Here is the problem, my build fail and the error log is 'xcopy is not recognized as an internal or external command, operable program or batch file'. The path is correctly set, xcopy do works from a windows command line and from the visual studio command line (the one set with the project environment). I

Merge all .txt files in all subdirectories in one txt file

老子叫甜甜 提交于 2019-12-20 14:41:10
问题 I want to merge content of all .txt files in my directory (containing subdirectories) to one txt file. I need to do this: xcopy text1.txt + text2.txt text3.txt but in a for loop which takes all text files in current directory. i assume something like this: for \r ___ in ___ do copy list.txt Thanks in advance. 回答1: Use one % instead of two %% to run it from the command line. for /r "c:\folder" %%a in (*.txt) do type "%%a" >>"bigfile.txt" 回答2: Try: @echo off set "folder=folder" for /F %%a in (

Merge all .txt files in all subdirectories in one txt file

China☆狼群 提交于 2019-12-20 14:39:20
问题 I want to merge content of all .txt files in my directory (containing subdirectories) to one txt file. I need to do this: xcopy text1.txt + text2.txt text3.txt but in a for loop which takes all text files in current directory. i assume something like this: for \r ___ in ___ do copy list.txt Thanks in advance. 回答1: Use one % instead of two %% to run it from the command line. for /r "c:\folder" %%a in (*.txt) do type "%%a" >>"bigfile.txt" 回答2: Try: @echo off set "folder=folder" for /F %%a in (

Copy specific files into subfolder in batch

送分小仙女□ 提交于 2019-12-20 05:01:54
问题 I have a Windows Batch file that I'm running to move specific files into a subfolder. @ECHO OFF ECHO Start Copy setlocal enabledelayedexpansion set SOURCE_DIR=C:\Users\paul.ikeda\Support\SNDataDemo91\SolidCAD\Inventor_in set DEST_DIR=C:\Users\paul.ikeda\Support\SNDataDemo91\SolidCAD\Inventor_in\Files to Import set FILENAMES_TO_COPY=SN_Router_1.ipt SN_Router_2.ipt SN_Router_3.ipt for /R "%SOURCE_DIR%" %%F IN (%FILENAMES_TO_COPY%) do ( if exist "%%F" ( set FILE_DIR=%%~dpF set FILE_INTERMEDIATE

Execute windows batch command from Jenkins fails but runs fine in cmd.exe

青春壹個敷衍的年華 提交于 2019-12-18 12:24:47
问题 I am trying to run this command in jenkins after a MSbuild xcopy "C:\Program Files (x86)\Jenkins\workspace\trunk\Projects\results\results\obj\Debug\Package\PackageTmp" "Y:\Extraction_Zone\Jenkins\" /E Y: is a mapped network drive. This runs fine in cmd.exe but when trying to run it in Jenkins, I am getting the error Invalid drive specification . Here is the output from jenkins: Time Elapsed 00:00:04.03 [trunk] $ cmd /c call C:\Windows\TEMP\hudson3389873107474371072.bat C:\Program Files (x86)

vb6 xcopy deployment

牧云@^-^@ 提交于 2019-12-17 19:03:46
问题 Can any one tell me how to convert an legacy application which is vb6 ( COM dll's ocx and exes) to use Regfree COM . I tried opening the dlls in visual studio and created manifest file, but some of the dlls it is giving error. Is there any tools out there which will help me to do this process? I tried a tool from codeproject which is called regsvr42, which is not creating the manifest fully. I used tools like PE explorer where I get all the typelib information , but converting them into

/exclude in xcopy just for a file type

岁酱吖の 提交于 2019-12-17 17:36:24
问题 I have a batch file to copy over files from Visual Studio to my Web folder. I want to copy all files in my web project, EXCEPT for *.cs files. I can't seem to get this to work: xcopy /r /d /i /s /y /exclude:".cs" C:\dev\apan C:\web\apan Any tips? I just get exit code 4 when I try to run this. 回答1: The /EXCLUDE: argument expects a file containing a list of excluded files. So create a file called excludedfileslist.txt containing: .cs\ Then a command like this: xcopy /r /d /i /s /y /exclude

Why does xcopy exit with code 9009 in Visual Studio post-build step?

青春壹個敷衍的年華 提交于 2019-12-17 16:02:13
问题 I am getting the following error, which I don't understand. Any suggestions? Error 1 The command "xcopy "D:\Users\johndoe\Documents\Visual Studio 2008\Projects\MyProject\MyProject.Modules.Ribbon\bin\Debug\MyProject.Modules.Ribbon.dll" "D:\Users\johndoe\Documents\Visual Studio 2008\Projects\MyProject\MyProject\bin\Debug\Modules\" /Y" exited with code 9009. MyProject.Modules.Ribbon 回答1: I encounted this error on the TeamCity build server. I finally resolved it after checking the build log and