Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
How to handle spaces in dir. name?
Name: newbee Date: March 30, 2009 at 01:43:05 Pacific OS: Windows XP Subcategory: Batch
Comment:
Hi all
I have ran in to some minor problem in my bat file. If I try to move a file into a directory that contain spaces in the name e.g Dir A the file will not move into that directory.
If I rename the directory name to DirA then the files will move there.
From the help I got from my other postings in this topic
for /f "tokens=* delims= " %%a in ('dir/b CIS_A_*.pdf') do (move %%a C:\Dir A)
And so to the question, is it possible to contain the space in the directory name or do I have to rename all the directories containing spaces in the name of the directory ?
Name: reno Date: March 30, 2009 at 02:14:41 Pacific
Reply:
put quotes around it "%%a" "Dir A"
now i am wondering which one is faster: for /f "tokens=* delims= " %%a in ('dir/b CIS_A_*.pdf') do for /f "tokens=*" %%a in ('dir/b CIS_A_*.pdf') do for /f "delims=" %%a in ('dir/b CIS_A_*.pdf') do
Summary: Is there any way to replace the spaces in folder names with an underscore? For example, given these directories: C:\MainFld\Folder 1\001\ C:\MainFld\Folder2\00 2\ rename them to: C:\MainFld\Folder_1\...
Summary: iam working on natural language processing. and all the programming is done in VB with sql server 2000 as back end. we r planning to store sentences in the form of binary trees. the problem is iam not...
Summary: Hello all, I've been trying to get a batch file that will go to a specified directory count the number of files (any file and a files with a specific extension, we're searching multiple dir's) and...