A seemingly undocumented trick is to put a *
at the end of the destination – then xcopy
will copy as a file, like so
xcopy c:\source\file.txt c:\destination\newfile.txt*
The echo f | xcopy ...
trick does not work on localized versions of Windows, where the prompt is different.
More Related Contents:
- Why does the command XCOPY in batch file ask for file or folder?
- edit 2500 text files to add three decimal places for integer number and decimal number where you can find after @x*
- Command Prompt Separation of text by Character [closed]
- What are the undocumented features and limitations of the Windows FINDSTR command?
- Why does delayed expansion fail when inside a piped block of code?
- Ignore percent sign in batch file
- How to call a batch file that is one level up from the current directory?
- Make an environment variable survive ENDLOCAL
- Error: “is not recognized as an internal or external command, operable program or batch file”
- How to read file contents into a variable in a batch file?
- How to create empty text file from a batch file?
- Adding the current directory to Windows path permanently
- What does :: (double colon) mean in DOS batch files?
- How to use if – else structure in a batch file?
- How to get and display yesterday date?
- How to make .BAT file delete it self after completion?
- Arithmetic operations with HH:MM:SS times in batch file
- How to Copy (and increment) Multiple Instances of a File Using Batch File
- set /p empty answer crash
- Specify the size of command prompt when executing a batch file
- How to call a batch file that is one level up from the current batch file directory?
- batch file to delete files older than a specified date [duplicate]
- Get java version from batch file
- For /F with wmic unwanted output
- Set a path variable with spaces in the path in a Windows .cmd file or batch file
- How to store the result of a command expression in a variable using bat scripts?
- Get last created directory batch command
- How to code a spinner for waiting processes in a Batch file?
- Is there a short cut for desktop folder in Windows batch?
- Batch file and DEL errorlevel 0 issue