CFF KB - Carrz-Fox-Fire Promotions Knowledge Base
CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.Knowledge Base
- Breadrumbs:
Dos Prompt rename a file with spaces in the name using wildcards
- Article ID:
32 - Date Created
Sunday, October 10, 2010 - Last Updated
Tuesday, November 16, 2010 - This Article Has been Viewed
6140 times - Short Desc
Renaming a file with spaces in the name will give you an error when using a Dos Prompt or Command Prompt. - Details
When using a dos prompt or command prompt and trying to rename a file which has spaces in the name: my file.txt will result in an error
The syntax of the command is incorrect.
The use of Wildcards will be needed in order to rename your spaced files and folders - Recreate Issue
To recreate this issue, perform the following action in a command prompt
Substituting the U:\Files
For your actual drive and folder path.
U:\Files\rename my file.txt my file.doc
The syntax of the command is incorrect. - Resolve Issue
To properly write out the dos command to rename your file with spaces, perform the following action.
(This will come in handy if you are unable to rename the file in windows do to the file being in use)
U:\Files\rename my?file.txt my?file.doc
As you can see above, we have added in a Question Mark ?
In place of the spaces in the name of the file.
What this does is give a legal dos filename character.
If you leave the ? mark off from the output filename like this
U:\Files\rename my?file.txt my file.doc
The output renamed file will be my_file.doc
See, the ? in the original filename with add an underscrore to the output filename.
But adding in the ? in the output filename, makes it so that you can rename the file with the original space still in tact.
Share With Friends (Updated 6-8-2010)
Recent Articles
All Topics
- Coming Soon - Knowledge Exchange
Trending Articles
- Microsoft VBScript runtime error '800a0046' Permission denied FileSystemObject 24695
- Microsoft OLE DB Provider for SQL Server error '80040e57' String or binary data would be truncated. or The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. 21297
- ADODB.Parameters error '800a0e7c' Parameter object is improperly defined 19545
- After Effects warning: Audio conforming failed for the following file .cfa. Perhaps due to disk space 17785
- The backup set holds a backup of a database other than the existing 16826